OpenMS
Loading...
Searching...
No Matches
LogStream.h File Reference
#include <OpenMS/CONCEPT/Macros.h>
#include <OpenMS/DATASTRUCTURES/StringUtils.h>
#include <sstream>
#include <iostream>
#include <list>
#include <vector>
#include <ctime>
#include <map>
Include dependency graph for LogStream.h:

Go to the source code of this file.

Classes

class  LogStreamBuf
 Stream buffer used by LogStream. More...
 
struct  LogStreamBuf::StreamStruct
 Holds a stream that is connected to the LogStream. It also includes the minimum and maximum level at which the LogStream redirects messages to this stream. More...
 
struct  LogStreamBuf::LogCacheStruct
 Holds a counter of occurrences and an index for the occurrence sequence of the corresponding log message. More...
 
class  LogStreamNotifier
 Sink-side hook that is notified whenever a LogStream flushes a complete message. More...
 
class  LogStream
 Log Stream Class. More...
 
class  LogSinkGuard
 RAII guard that temporarily removes a stream from a LogStream and re-inserts it on scope exit. More...
 

Namespaces

namespace  OpenMS
 Main OpenMS namespace.
 
namespace  OpenMS::Logger
 Log streams.
 

Macros

#define OPENMS_LOG_FATAL_ERROR    OpenMS::getThreadLocalLogFatal() << __FILE__ << "(" << __LINE__ << "): "
 Macro for fatal errors (processing stops) - includes file and line info.
 
#define OPENMS_LOG_ERROR    OpenMS::getThreadLocalLogError()
 Macro for non-fatal errors (processing continues)
 
#define OPENMS_LOG_WARN    OpenMS::getThreadLocalLogWarn()
 Macro for warnings.
 
#define OPENMS_LOG_INFO    OpenMS::getThreadLocalLogInfo()
 Macro for information/status messages.
 
#define OPENMS_LOG_DEBUG    OpenMS::getThreadLocalLogDebug() << past_last_slash(__FILE__) << "(" << __LINE__ << "): "
 Macro for debug information - includes file and line info.
 
#define OPENMS_LOG_DEBUG_NOFILE    OpenMS::getThreadLocalLogDebug()
 Macro for debug information (without file info)
 

Functions

Logger::LogStreamgetThreadLocalLogFatal ()
 Get thread-local fatal error log stream.
 
Logger::LogStreamgetThreadLocalLogError ()
 Get thread-local error log stream.
 
Logger::LogStreamgetThreadLocalLogWarn ()
 Get thread-local warning log stream.
 
Logger::LogStreamgetThreadLocalLogInfo ()
 Get thread-local info log stream.
 
Logger::LogStreamgetThreadLocalLogDebug ()
 Get thread-local debug log stream.
 
Global LogStream accessor functions

These functions provide access to global LogStream instances for configuration purposes (e.g., adding/removing output streams). For actual logging, use the OPENMS_LOG_* macros which use thread-local streams to avoid data races.

Warning
Direct logging to global streams is NOT thread-safe. Use OPENMS_LOG_* macros instead.
Logger::LogStreamgetGlobalLogFatal ()
 Get the global fatal error log stream for configuration purposes.
 
Logger::LogStreamgetGlobalLogError ()
 Get the global error log stream for configuration purposes.
 
Logger::LogStreamgetGlobalLogWarn ()
 Get the global warning log stream for configuration purposes.
 
Logger::LogStreamgetGlobalLogInfo ()
 Get the global info log stream for configuration purposes.
 
Logger::LogStreamgetGlobalLogDebug ()
 Get the global debug log stream for configuration purposes.
 

Class Documentation

◆ OpenMS::Logger::LogStreamBuf::LogCacheStruct

struct OpenMS::Logger::LogStreamBuf::LogCacheStruct

Holds a counter of occurrences and an index for the occurrence sequence of the corresponding log message.

Collaboration diagram for LogStreamBuf::LogCacheStruct:
[legend]
Class Members
int counter
Size timestamp

Macro Definition Documentation

◆ OPENMS_LOG_DEBUG

#define OPENMS_LOG_DEBUG    OpenMS::getThreadLocalLogDebug() << past_last_slash(__FILE__) << "(" << __LINE__ << "): "

Macro for debug information - includes file and line info.

◆ OPENMS_LOG_DEBUG_NOFILE

#define OPENMS_LOG_DEBUG_NOFILE    OpenMS::getThreadLocalLogDebug()

Macro for debug information (without file info)

◆ OPENMS_LOG_ERROR

#define OPENMS_LOG_ERROR    OpenMS::getThreadLocalLogError()

Macro for non-fatal errors (processing continues)

◆ OPENMS_LOG_FATAL_ERROR

#define OPENMS_LOG_FATAL_ERROR    OpenMS::getThreadLocalLogFatal() << __FILE__ << "(" << __LINE__ << "): "

Macro for fatal errors (processing stops) - includes file and line info.

◆ OPENMS_LOG_INFO

#define OPENMS_LOG_INFO    OpenMS::getThreadLocalLogInfo()

Macro for information/status messages.

◆ OPENMS_LOG_WARN

#define OPENMS_LOG_WARN    OpenMS::getThreadLocalLogWarn()

Macro for warnings.