20#ifndef REALM_LOGGING_H
21#define REALM_LOGGING_H
33#ifndef REALM_LOGGING_MIN_LEVEL
35#ifdef COMPILE_TIME_MIN_LEVEL
36#define REALM_LOGGING_MIN_LEVEL COMPILE_TIME_MIN_LEVEL
38#define REALM_LOGGING_MIN_LEVEL LEVEL_DEBUG
49 class LoggerOutputStream;
50 struct DelayedMessage;
112 friend class LoggerConfig;
116 bool flush_each_write);
148 template <
typename T>
174 const char *msgdata,
size_t msglen) = 0;
180#include "realm/logging.inl"
Logger * logger
Definition logging.h:161
LoggerMessage & vprintf(const char *fmt, va_list ap)
std::ostream & get_stream(void)
DeferredConstructor< std::ostream > stream
Definition logging.h:166
LoggerMessage(const LoggerMessage &to_copy)
bool active
Definition logging.h:162
LoggerMessage & operator<<(const T &val)
bool is_active(void) const
LoggerMessage(Logger *_logger, bool _active, Logger::LoggingLevel _level)
Logger::LoggingLevel level
Definition logging.h:163
DeferredConstructor< shortstringbuf< 160, 256 > > buffer
Definition logging.h:165
virtual void log_msg(Logger::LoggingLevel level, const char *name, const char *msgdata, size_t msglen)=0
virtual ~LoggerOutputStream()
Definition logging.h:171
bool want_print(void) const
LoggerMessage warning(void)
static void configure_from_cmdline(std::vector< std::string > &cmdline)
static void set_logger_output(const std::string &name, LoggerOutputStream *s)
std::string name
Definition logging.h:127
const std::string & get_name(void) const
REALM_ATTR_PRINTF_FORMAT(void debug(const char *fmt,...), 2, 3)
LoggerMessage debug(void)
LoggingLevel log_level
Definition logging.h:129
bool configured
Definition logging.h:130
bool want_error(void) const
std::vector< LogStream > streams
Definition logging.h:128
REALM_ATTR_PRINTF_FORMAT(void warning(const char *fmt,...), 2, 3)
bool want_info(void) const
REALM_INTERNAL_API_EXTERNAL_LINKAGE void log_msg(LoggingLevel level, const char *msgdata, size_t msglen)
static void set_default_output(LoggerOutputStream *s)
bool want_fatal(void) const
REALM_INTERNAL_API void configure_done(void)
LoggingLevel
Definition logging.h:58
@ LEVEL_NONE
Definition logging.h:66
@ LEVEL_PRINT
Definition logging.h:62
@ LEVEL_SPEW
Definition logging.h:59
@ LEVEL_WARNING
Definition logging.h:63
@ LEVEL_DEBUG
Definition logging.h:60
@ LEVEL_FATAL
Definition logging.h:65
@ LEVEL_ERROR
Definition logging.h:64
@ LEVEL_INFO
Definition logging.h:61
LoggerMessage fatal(void)
LoggerMessage error(void)
REALM_INTERNAL_API void add_stream(LoggerOutputStream *s, LoggingLevel min_level, bool delete_when_done, bool flush_each_write)
bool want_spew(void) const
Logger(const std::string &_name)
bool want_warning(void) const
REALM_ATTR_PRINTF_FORMAT(void error(const char *fmt,...), 2, 3)
REALM_ATTR_PRINTF_FORMAT(void info(const char *fmt,...), 2, 3)
REALM_ATTR_PRINTF_FORMAT(void spew(const char *fmt,...), 2, 3)
LoggerMessage print(void)
bool want_debug(void) const
LoggingLevel get_level(void) const
REALM_ATTR_PRINTF_FORMAT(void print(const char *fmt,...), 2, 3)
LoggerMessage newmsg(LoggingLevel level)
DelayedMessage * delayed_message_head
Definition logging.h:132
DelayedMessage ** delayed_message_tail
Definition logging.h:133
REALM_ATTR_PRINTF_FORMAT(void fatal(const char *fmt,...), 2, 3)
#define REALM_INTERNAL_API_EXTERNAL_LINKAGE
Definition compiler_support.h:218
#define REALM_INTERNAL_API
Definition compiler_support.h:219
#define REALM_PUBLIC_API
Definition compiler_support.h:217
Definition activemsg.h:38
bool delete_when_done
Definition logging.h:123
LoggerOutputStream * s
Definition logging.h:121
bool flush_each_write
Definition logging.h:124
LoggingLevel min_level
Definition logging.h:122