BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Classes | Namespaces | Macros | Typedefs | Functions
log_message.hpp File Reference

Defines types and helper macros necessary for generating log messages. More...

#include <fc/config.hpp>
#include <fc/time.hpp>
#include <fc/variant_object.hpp>
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  fc::log_level
 
class  fc::log_context
 provides information about where and when a log message was generated. More...
 
class  fc::log_message
 aggregates a message along with the context and associated meta-information. More...
 

Namespaces

 fc
 
 fc::detail
 

Macros

#define __func__   __FUNCTION__
 
#define FC_LOG_CONTEXT(LOG_LEVEL)   fc::log_context( fc::log_level::LOG_LEVEL, (const char*)__FILE__, __LINE__, (const char*)__func__ )
 Automatically captures the File, Line, and Method names and passes them to the constructor of fc::log_context along with LOG_LEVEL. More...
 
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT, ...)
 A helper method for generating log messages. More...
 

Typedefs

typedef std::vector< log_message > fc::log_messages
 

Functions

void fc::to_variant (log_level e, variant &v, uint32_t max_depth=1)
 
void fc::from_variant (const variant &e, log_level &ll, uint32_t max_depth=1)
 
void fc::to_variant (const log_context &l, variant &v, uint32_t max_depth)
 
void fc::from_variant (const variant &l, log_context &c, uint32_t max_depth)
 
void fc::to_variant (const log_message &l, variant &v, uint32_t max_depth)
 
void fc::from_variant (const variant &l, log_message &c, uint32_t max_depth)
 
 FC_REFLECT_TYPENAME (fc::log_message)
 

Detailed Description

Defines types and helper macros necessary for generating log messages.

Definition in file log_message.hpp.

Macro Definition Documentation

◆ __func__

#define __func__   __FUNCTION__

Definition at line 142 of file log_message.hpp.

◆ FC_LOG_CONTEXT

#define FC_LOG_CONTEXT (   LOG_LEVEL)    fc::log_context( fc::log_level::LOG_LEVEL, (const char*)__FILE__, __LINE__, (const char*)__func__ )

Automatically captures the File, Line, and Method names and passes them to the constructor of fc::log_context along with LOG_LEVEL.

Parameters
LOG_LEVEL- a valid log_level::Enum name.

Definition at line 151 of file log_message.hpp.

◆ FC_LOG_MESSAGE

#define FC_LOG_MESSAGE (   LOG_LEVEL,
  FORMAT,
  ... 
)
Value:

A helper method for generating log messages.

Parameters
LOG_LEVELa valid log_level::Enum name to be passed to the log_context
FORMATA const char* string containing zero or more references to keys as "${key}"
...A set of key/value pairs denoted as ("key",val)("key2",val2)...

Definition at line 163 of file log_message.hpp.

Function Documentation

◆ FC_REFLECT_TYPENAME()

FC_REFLECT_TYPENAME ( fc::log_message  )
FC_LOG_CONTEXT
#define FC_LOG_CONTEXT(LOG_LEVEL)
Automatically captures the File, Line, and Method names and passes them to the constructor of fc::log...
Definition: log_message.hpp:151
FC_MAX_LOG_OBJECT_DEPTH
#define FC_MAX_LOG_OBJECT_DEPTH
Definition: config.hpp:8
fc::limited_mutable_variant_object
Definition: variant_object.hpp:220
fc::log_message
aggregates a message along with the context and associated meta-information.
Definition: log_message.hpp:106