BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
Classes | Namespaces | Macros
logger.hpp File Reference
#include <fc/config.hpp>
#include <fc/time.hpp>
#include <fc/log/appender.hpp>
#include <fc/log/log_message.hpp>
#include <cstddef>
#include <memory>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/punctuation/paren.hpp>

Go to the source code of this file.

Classes

class  fc::logger
 

Namespaces

 fc
 

Macros

#define DEFAULT_LOGGER
 
#define FC_MULTILINE_MACRO_BEGIN   do {
 
#define FC_MULTILINE_MACRO_END   } while (0)
 
#define fc_dlog(LOGGER, FORMAT, ...)
 
#define fc_ilog(LOGGER, FORMAT, ...)
 
#define fc_wlog(LOGGER, FORMAT, ...)
 
#define fc_elog(LOGGER, FORMAT, ...)
 
#define dlog(FORMAT, ...)
 
#define ulog(FORMAT, ...)
 
#define ilog(FORMAT, ...)
 
#define wlog(FORMAT, ...)
 
#define elog(FORMAT, ...)
 
#define FC_FORMAT_ARG(r, unused, base)   BOOST_PP_STRINGIZE(base) ": ${" BOOST_PP_STRINGIZE( base ) "} "
 
#define FC_FORMAT_ARGS(r, unused, base)   BOOST_PP_LPAREN() BOOST_PP_STRINGIZE(base),fc::variant(base,FC_MAX_LOG_OBJECT_DEPTH) BOOST_PP_RPAREN()
 
#define FC_FORMAT(SEQ)   BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARG, v, SEQ )
 
#define FC_FORMAT_ARG_PARAMS(...)   BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARGS, v, __VA_ARGS__ )
 
#define FC_DUMP_FORMAT_ARG_NAME(r, unused, base)   "(" BOOST_PP_STRINGIZE(base) ")"
 
#define FC_DUMP_FORMAT_ARG_NAMES(SEQ)   BOOST_PP_SEQ_FOR_EACH( FC_DUMP_FORMAT_ARG_NAME, v, SEQ )
 
#define idump(SEQ)
 
#define wdump(SEQ)
 
#define edump(SEQ)
 

Macro Definition Documentation

#define DEFAULT_LOGGER

Definition at line 60 of file logger.hpp.

#define dlog (   FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
(fc::logger::get(DEFAULT_LOGGER)).log( FC_LOG_MESSAGE( debug, FORMAT, __VA_ARGS__ ) ); \
static logger get(const std::string &name="default")
Definition: logger.cpp:87
#define DEFAULT_LOGGER
Definition: logger.hpp:60
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 100 of file logger.hpp.

#define edump (   SEQ)
Value:
{ \
try { \
} catch( ... ) { \
elog ( "[ERROR: Got exception while trying to dump ( ${args} )]",("args",FC_DUMP_FORMAT_ARG_NAMES(SEQ)) ); \
} \
}
#define FC_FORMAT(SEQ)
Definition: logger.hpp:149
#define elog(FORMAT,...)
Definition: logger.hpp:129
#define FC_FORMAT_ARG_PARAMS(...)
Definition: logger.hpp:154
#define FC_DUMP_FORMAT_ARG_NAMES(SEQ)
Definition: logger.hpp:160

Definition at line 182 of file logger.hpp.

#define elog (   FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
(fc::logger::get(DEFAULT_LOGGER)).log( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \
static logger get(const std::string &name="default")
Definition: logger.cpp:87
#define DEFAULT_LOGGER
Definition: logger.hpp:60
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 129 of file logger.hpp.

#define fc_dlog (   LOGGER,
  FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
if( (LOGGER).is_enabled( fc::log_level::debug ) ) \
(LOGGER).log( FC_LOG_MESSAGE( debug, FORMAT, __VA_ARGS__ ) ); \
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 76 of file logger.hpp.

#define FC_DUMP_FORMAT_ARG_NAME (   r,
  unused,
  base 
)    "(" BOOST_PP_STRINGIZE(base) ")"

Definition at line 157 of file logger.hpp.

#define FC_DUMP_FORMAT_ARG_NAMES (   SEQ)    BOOST_PP_SEQ_FOR_EACH( FC_DUMP_FORMAT_ARG_NAME, v, SEQ )

Definition at line 160 of file logger.hpp.

#define fc_elog (   LOGGER,
  FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
if( (LOGGER).is_enabled( fc::log_level::error ) ) \
(LOGGER).log( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 94 of file logger.hpp.

#define FC_FORMAT (   SEQ)    BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARG, v, SEQ )

Definition at line 149 of file logger.hpp.

#define FC_FORMAT_ARG (   r,
  unused,
  base 
)    BOOST_PP_STRINGIZE(base) ": ${" BOOST_PP_STRINGIZE( base ) "} "

Definition at line 143 of file logger.hpp.

#define FC_FORMAT_ARG_PARAMS (   ...)    BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARGS, v, __VA_ARGS__ )

Definition at line 154 of file logger.hpp.

#define FC_FORMAT_ARGS (   r,
  unused,
  base 
)    BOOST_PP_LPAREN() BOOST_PP_STRINGIZE(base),fc::variant(base,FC_MAX_LOG_OBJECT_DEPTH) BOOST_PP_RPAREN()

Definition at line 146 of file logger.hpp.

#define fc_ilog (   LOGGER,
  FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
if( (LOGGER).is_enabled( fc::log_level::info ) ) \
(LOGGER).log( FC_LOG_MESSAGE( info, FORMAT, __VA_ARGS__ ) ); \
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 82 of file logger.hpp.

#define FC_MULTILINE_MACRO_BEGIN   do {

Definition at line 65 of file logger.hpp.

#define FC_MULTILINE_MACRO_END   } while (0)

Definition at line 73 of file logger.hpp.

#define fc_wlog (   LOGGER,
  FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
if( (LOGGER).is_enabled( fc::log_level::warn ) ) \
(LOGGER).log( FC_LOG_MESSAGE( warn, FORMAT, __VA_ARGS__ ) ); \
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 88 of file logger.hpp.

#define idump (   SEQ)
Value:
{ \
try { \
} catch( ... ) { \
ilog ( "[ERROR: Got exception while trying to dump ( ${args} )]",("args",FC_DUMP_FORMAT_ARG_NAMES(SEQ)) ); \
} \
}
#define FC_FORMAT(SEQ)
Definition: logger.hpp:149
#define FC_FORMAT_ARG_PARAMS(...)
Definition: logger.hpp:154
#define FC_DUMP_FORMAT_ARG_NAMES(SEQ)
Definition: logger.hpp:160
#define ilog(FORMAT,...)
Definition: logger.hpp:117

Definition at line 166 of file logger.hpp.

#define ilog (   FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
(fc::logger::get(DEFAULT_LOGGER)).log( FC_LOG_MESSAGE( info, FORMAT, __VA_ARGS__ ) ); \
static logger get(const std::string &name="default")
Definition: logger.cpp:87
#define DEFAULT_LOGGER
Definition: logger.hpp:60
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 117 of file logger.hpp.

#define ulog (   FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
if( (fc::logger::get("user")).is_enabled( fc::log_level::debug ) ) \
(fc::logger::get("user")).log( FC_LOG_MESSAGE( debug, FORMAT, __VA_ARGS__ ) ); \
static logger get(const std::string &name="default")
Definition: logger.cpp:87
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Sends the log message to a special 'user' log stream designed for messages that the end user may like to see.

Definition at line 110 of file logger.hpp.

#define wdump (   SEQ)
Value:
{ \
try { \
} catch( ... ) { \
wlog ( "[ERROR: Got exception while trying to dump ( ${args} )]",("args",FC_DUMP_FORMAT_ARG_NAMES(SEQ)) ); \
} \
}
#define FC_FORMAT(SEQ)
Definition: logger.hpp:149
#define wlog(FORMAT,...)
Definition: logger.hpp:123
#define FC_FORMAT_ARG_PARAMS(...)
Definition: logger.hpp:154
#define FC_DUMP_FORMAT_ARG_NAMES(SEQ)
Definition: logger.hpp:160

Definition at line 174 of file logger.hpp.

#define wlog (   FORMAT,
  ... 
)
Value:
FC_MULTILINE_MACRO_BEGIN \
(fc::logger::get(DEFAULT_LOGGER)).log( FC_LOG_MESSAGE( warn, FORMAT, __VA_ARGS__ ) ); \
static logger get(const std::string &name="default")
Definition: logger.cpp:87
#define DEFAULT_LOGGER
Definition: logger.hpp:60
#define FC_MULTILINE_MACRO_END
Definition: logger.hpp:73
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.

Definition at line 123 of file logger.hpp.