6#include <unordered_map>
59 return e >= my->_level;
63 std::unique_lock g( log_config::get().log_mutex );
66 for(
auto itr = my->_appenders.begin(); itr != my->_appenders.end(); ++itr ) {
70 std::cerr <<
"ERROR: logger::log fc::exception: " << er.
to_detail_string() << std::endl;
71 }
catch(
const std::exception& e ) {
72 std::cerr <<
"ERROR: logger::log std::exception: " << e.what() << std::endl;
74 std::cerr <<
"ERROR: logger::log unknown exception: " << std::endl;
78 if( my->_additivity && my->_parent !=
nullptr) {
79 logger parent = my->_parent;
102 void logger::add_appender(
const std::shared_ptr<appender>&
a ) {
103 my->_appenders.push_back(
a);
Used to generate a useful error report when an exception is thrown.
std::string to_detail_string(log_level ll=log_level::all) const
void append_context(const fc::string &c)
aggregates a message along with the context and associated meta-information.
log_context get_context() const
std::vector< appender::ptr > _appenders
static void update(const fc::string &name, logger &log)
logger get_parent() const
logger & operator=(const logger &)
logger & set_log_level(log_level e)
static logger get(const fc::string &name=DEFAULT_LOGGER)
logger & set_parent(const logger &l)
void set_name(const fc::string &n)
log_level get_log_level() const
const fc::string & name() const
bool is_enabled(log_level e) const
Defines exception's used by fc.
Defines types and helper macros necessary for generating log messages.
bool operator!=(const array< T, N > &a, const array< T, N > &b)
bool operator==(const array< T, N > &a, const array< T, N > &b)
void configure_logging(const fc::path &log_config)
decltype(nullptr) nullptr_t
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
static logger get_logger(const fc::string &name)
static void update_logger(const fc::string &name, logger &log)
static logging_config default_config()