With std::thread
, it is now trivial to keep a list of threads names in the program state (either by wrapping the thread, or by using a singleton to manage the thread list.)
I am starting to use log4cxx for my logging, and I'd like to have it display the thread name. However, this means I cannot use the PatternLayout. The thread numbers aren't very useful on their own.
What is the best way to do this? Am I stuck with just outputting a map, or can I override PatternLayout
/ConversionPattern
in a clever way to do what I want? And if I overload it, how do I point to the class in the config file? Or can I possibly add a conversion character?