Go to the documentation of this file.
71 (void)fprintf(stderr,
"%s",
msg);
98 if (
line.m_line.empty())
102 *file <<
line.m_line;
116 if (
line.m_line.empty())
120 *file <<
line.m_line;
133 auto old =
line.m_level;
134 line.m_level = level;
static void OutputDebugStringA(const char *msg)
JournalLogLevel lineLevel(int thread)
void flushAll(JournalFile *file)
Flush all available non-empty lines to the supplied file, clearing lines as they are flushed.
JournalThreader()
Constructor, sets up the necessary structures for threaded logging.
~JournalThreader()
Destructor, flushes all remaining data.
void cleanup(int id)
Remove the thread-local storage for thread id.
ThreadLine & threadLine(int thread)
Get the line object for the supplied thread, typically for the current thread.
A class containing a journal file and some meta-data.
JournalLogLevel setLineLevel(int thread, JournalLogLevel level)
Set the log level of the queued line.
ThreadLine & nextLine()
Get the next non-empty line object from the map of all threads, returns an empty line object if no no...
std::string & line(int thread)
bool unlock() noexcept
Unlocks the locked mutex.
void writeLine(int thread, JournalFile *file)
Write the line for thread thread to file file.
Storage for logging queue of a specific thread.
std::map< int, ThreadLine > m_map
The contained lines, one for each thread.
xsens::Mutex m_mutex
A mutex guarding access to the map (not to the lines)