Go to the documentation of this file.
65 #ifndef JOURNALTHREADER_H
66 #define JOURNALTHREADER_H
71 #if JOURNALLER_WITH_THREAD_SUPPORT
89 std::string&
line(
int thread);
105 #if JOURNALLER_WITH_THREAD_SUPPORT
113 return m_map[thread];
120 for (
auto it =
m_map.begin(); it !=
m_map.end(); ++it)
121 if (!it->second.m_line.empty())
@ JLL_Write
only log 'write' messages
JournalLogLevel lineLevel(int thread)
void flushAll(JournalFile *file)
Flush all available non-empty lines to the supplied file, clearing lines as they are flushed.
JournalLogLevel m_level
The level of this log line.
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.
ThreadLine()
Constructor, creates an empty line at WRITE log level.
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)
void writeLine(int thread, JournalFile *file)
Write the line for thread thread to file file.
Storage for logging queue of a specific thread.
std::string m_line
The contained text for this log line.
std::map< int, ThreadLine > m_map
The contained lines, one for each thread.
Manages threaded writes for the Journaller objects.
xsens::Mutex m_mutex
A mutex guarding access to the map (not to the lines)