105 public std::streambuf
213 char * pbuf_ =
nullptr;
460 #define OPENMS_LOG_FATAL_ERROR \
461 OPENMS_THREAD_CRITICAL(LOGSTREAM) \
462 OpenMS_Log_fatal << __FILE__ << "(" << __LINE__ << "): "
465 #define OPENMS_LOG_ERROR \
466 OPENMS_THREAD_CRITICAL(LOGSTREAM) \
470 #define OPENMS_LOG_WARN \
471 OPENMS_THREAD_CRITICAL(LOGSTREAM) \
475 #define OPENMS_LOG_INFO \
476 OPENMS_THREAD_CRITICAL(LOGSTREAM) \
480 #define OPENMS_LOG_DEBUG \
481 OPENMS_THREAD_CRITICAL(LOGSTREAM) \
482 OpenMS_Log_debug << [](){ constexpr const char* x = (past_last_slash(__FILE__)); return x; }() << "(" << __LINE__ << "): "
485 #define OPENMS_LOG_DEBUG_NOFILE \
486 OPENMS_THREAD_CRITICAL(LOGSTREAM) \
Color and style the fonts shown on cout/cerr (or other streams)
Definition: Colorizer.h:97
Stream buffer used by LogStream.
Definition: LogStream.h:106
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:239
std::string expandPrefix_(const std::string &prefix, time_t time) const
Interpret the prefix format string and return the expanded prefix.
std::string level_
Definition: LogStream.h:214
std::list< StreamStruct > stream_list_
Definition: LogStream.h:215
int counter
Definition: LogStream.h:227
Size timestamp
Definition: LogStream.h:226
std::map< std::string, LogCacheStruct > log_cache_
Cache of the last two log messages.
Definition: LogStream.h:237
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:216
void distribute_(const std::string &outstring)
Distribute a new message to connected streams.
static const std::string UNKNOWN_LOG_LEVEL
Definition: LogStream.h:115
bool isInCache_(std::string const &line)
Checks if the line is already in the cache.
static const time_t MAX_TIME
Definition: LogStream.h:114
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:225
Definition: LogStream.h:264
virtual ~LogStreamNotifier()
Destructor.
LogStreamNotifier()
Empty constructor.
LogStream * registered_at_
Definition: LogStream.h:285
void registerAt(LogStream &log_stream)
std::stringstream stream_
Definition: LogStream.h:283
Log Stream Class.
Definition: LogStream.h:318
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:443
~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:453
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)
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
const double c
Definition: Constants.h:214
static String prefix(const String &this_s, size_t length)
Definition: StringUtilsSimple.h:147
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Logger::LogStream OpenMS_Log_warn
Global static instance of a LogStream to capture messages classified as warnings. By default it is bo...
Logger::LogStream OpenMS_Log_error
Global static instance of a LogStream to capture messages classified as errors. By default it is boun...
Logger::LogStream OpenMS_Log_info
Global static instance of a LogStream to capture messages classified as information....
Logger::LogStream OpenMS_Log_fatal
Global static instance of a LogStream to capture messages classified as fatal errors....
Logger::LogStream OpenMS_Log_debug
Global static instance of a LogStream to capture messages classified as debug output....
Holds a stream that is connected to the LogStream. It also includes the minimum and maximum level at ...
Definition: LogStream.h:182
std::string prefix
Definition: LogStream.h:184
StreamStruct()
Definition: LogStream.h:187
LogStreamNotifier * target
Definition: LogStream.h:185
~StreamStruct()
Delete the notification target.
Definition: LogStream.h:193
std::ostream * stream
Definition: LogStream.h:183