203 char * pbuf_ =
nullptr;
425 void setPrefix(
const std::ostream & s,
const std::string & prefix);
484 : log_stream_(log_stream), stream_(stream)
486 log_stream_.remove(stream_);
492 log_stream_.insert(stream_);
542#define OPENMS_LOG_FATAL_ERROR \
543 OpenMS::getThreadLocalLogFatal() << __FILE__ << "(" << __LINE__ << "): "
546#define OPENMS_LOG_ERROR \
547 OpenMS::getThreadLocalLogError()
550#define OPENMS_LOG_WARN \
551 OpenMS::getThreadLocalLogWarn()
554#define OPENMS_LOG_INFO \
555 OpenMS::getThreadLocalLogInfo()
558#define OPENMS_LOG_DEBUG \
559 OpenMS::getThreadLocalLogDebug() << past_last_slash(__FILE__) << "(" << __LINE__ << "): "
562#define OPENMS_LOG_DEBUG_NOFILE \
563 OpenMS::getThreadLocalLogDebug()
Color and style the fonts shown on cout/cerr (or other streams)
Definition Colorizer.h:71
RAII guard that temporarily removes a stream from a LogStream and re-inserts it on scope exit.
Definition LogStream.h:475
LogSinkGuard(LogSinkGuard &&)=delete
LogSinkGuard(const LogSinkGuard &)=delete
LogSinkGuard & operator=(const LogSinkGuard &)=delete
LogSinkGuard(LogStream &log_stream, std::ostream &stream)
Construct a guard that removes the stream and re-inserts it on destruction.
Definition LogStream.h:483
LogSinkGuard & operator=(LogSinkGuard &&)=delete
~LogSinkGuard()
Destructor re-inserts the stream.
Definition LogStream.h:490
LogStream & log_stream_
Definition LogStream.h:502
std::ostream & stream_
Definition LogStream.h:503
Stream buffer used by LogStream.
Definition LogStream.h:80
Size getNextLogCounter_()
Returns the next free index for a log message.
std::map< Size, std::string > log_time_cache_
Cache of the occurrence sequence of the last two log messages.
Definition LogStream.h:229
std::string expandPrefix_(const std::string &prefix, time_t time) const
Interpret the prefix format string and return the expanded prefix.
LogStreamBuf(LogStreamBuf *source_buf, Colorizer *col=nullptr)
std::string level_
Definition LogStream.h:204
std::list< StreamStruct > stream_list_
Stream list for this buffer.
Definition LogStream.h:205
int counter
Definition LogStream.h:217
Size timestamp
Definition LogStream.h:216
const std::list< StreamStruct > & getStreamList_() const
std::map< std::string, LogCacheStruct > log_cache_
Cache of the last two log messages.
Definition LogStream.h:227
LogStreamBuf(const std::string &log_level=UNKNOWN_LOG_LEVEL, Colorizer *col=nullptr)
int syncLF_()
Non-lock acquiring sync function called in the d'tor.
void setLevel(std::string level)
std::string addToCache_(std::string const &line)
std::string incomplete_line_
Definition LogStream.h:206
void distribute_(const std::string &outstring)
Distribute a new message to connected streams.
std::list< StreamStruct > & getStreamList_()
Returns the stream list (owned or shared)
static const std::string UNKNOWN_LOG_LEVEL
Definition LogStream.h:89
bool isInCache_(std::string const &line)
Checks if the line is already in the cache.
static const time_t MAX_TIME
Definition LogStream.h:88
int overflow(int c=-1) override
Holds a counter of occurrences and an index for the occurrence sequence of the corresponding log mess...
Definition LogStream.h:215
Definition LogStream.h:254
virtual ~LogStreamNotifier()
Destructor.
LogStreamNotifier()
Empty constructor.
LogStream * registered_at_
Definition LogStream.h:275
void registerAt(LogStream &log_stream)
std::stringstream stream_
Definition LogStream.h:273
Log Stream Class.
Definition LogStream.h:308
bool hasStream_(std::ostream &stream)
LogStream(LogStreamBuf *buf=nullptr, bool delete_buf=true, std::ostream *stream=nullptr)
void insert(std::ostream &s)
std::list< LogStreamBuf::StreamStruct >::iterator StreamIterator
Definition LogStream.h:444
~LogStream() override
Clears all message buffers.
LogStreamBuf * operator->()
Arrow operator.
void setPrefix(const std::ostream &s, const std::string &prefix)
bool delete_buffer_
Definition LogStream.h:454
void insertNotification(std::ostream &s, LogStreamNotifier &target)
Add a notification target.
void setPrefix(const std::string &prefix)
Set prefix of all output streams, details see setPrefix method with ostream.
void setLevel(std::string level)
void remove(std::ostream &s)
StreamIterator findStream_(const std::ostream &stream)
void flushIncomplete()
Flush any incomplete line (text not terminated by newline) to all streams.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Logger::LogStream & getGlobalLogDebug()
Get the global debug log stream for configuration purposes.
Logger::LogStream & getThreadLocalLogDebug()
Get thread-local debug log stream.
Logger::LogStream & getGlobalLogError()
Get the global error log stream for configuration purposes.
Logger::LogStream & getThreadLocalLogInfo()
Get thread-local info log stream.
Logger::LogStream & getThreadLocalLogWarn()
Get thread-local warning log stream.
Logger::LogStream & getGlobalLogFatal()
Get the global fatal error log stream for configuration purposes.
Logger::LogStream & getThreadLocalLogFatal()
Get thread-local fatal error log stream.
Logger::LogStream & getGlobalLogWarn()
Get the global warning log stream for configuration purposes.
Logger::LogStream & getThreadLocalLogError()
Get thread-local error log stream.
Logger::LogStream & getGlobalLogInfo()
Get the global info log stream for configuration purposes.
Holds a stream that is connected to the LogStream. It also includes the minimum and maximum level at ...
Definition LogStream.h:168
std::string prefix
Definition LogStream.h:170
StreamStruct()
Definition LogStream.h:173
LogStreamNotifier * target
Definition LogStream.h:171
~StreamStruct()
Delete the notification target.
Definition LogStream.h:179
std::ostream * stream
Definition LogStream.h:169