Logger message: added %O for numeric OS thread id#843
Logger message: added %O for numeric OS thread id#843matejk wants to merge 3 commits intopocoproject:developfrom
Conversation
…ad id. Useful when using Poco logger in non-Poco threads (like std::thread) to be able to distinguish between threads in log messages.
|
The purpose of system-specific numeric thread id is to be able to use it logger to display thread ID when using non-Poco threads, like std::thread. If currentTid() is always numeric that it can be used for this purpose, yes. I'll update the code. |
…d implementation from Message.
|
Moved implementation from Message to Thread*. However I noticed that only some posix platforms have different pthread and OS thread IDs and it is more convenient for tracing purposes to use OS tids. One of the options would also be to change Posix implementation of Thread::getTid() to return OS numeric thread id instead of pthread_self (type pthread_t). |
|
The downside, as I mentioned, is a bit too many thread IDs for my taste; so, I'd modify |
|
Two thread IDs (one from Poco::Thread, one from system) should be enough. Three is definitely too many. |
|
Removed functions to get the third thread ID and rather changed implementation of tid() and currentTid() for posix implementation to return kernel threads for Linux and OS X. If this implementation is acceptable, I'd clean create new pull request with clean code changes. |
|
Created new pull request #846 with cleaned up code changes. |
Log message: added %O option to insert numeric platform specific thread id. Useful when using Poco logger in non-Poco threads (like std::thread) to be able to distinguish between threads in log messages.
Thread ID implemented for Linux and OSX.