ealogger
ealogger is a c++ library that provides a blazing fast and easy to use logging mechanism
|
Log message struct. More...
#include <logmessage.h>
Public Types | |
enum | LOGTYPE { DEFAULT = 0, STACK } |
The LOGTYPE enum stands for the LogMessage type. More... | |
typedef std::vector< std::string >::const_iterator | msg_vec_it |
A constant iterator typedef that is internally used. | |
Public Member Functions | |
LogMessage (ealogger::constants::LOG_LEVEL severity, std::string message, LOGTYPE log_type, std::string file, int lnumber, std::string func) | |
Initializes a log message object. More... | |
LogMessage (ealogger::constants::LOG_LEVEL severity, std::vector< std::string > message_vec, LOGTYPE log_type, std::string file, int lnumber, std::string func) | |
Initializes a log message object with a vector of message strings. More... | |
std::time_t | get_timepoint () |
Return the time_point when this message was created. More... | |
ealogger::constants::LOG_LEVEL | get_severity () |
Returns the severity of the message. More... | |
std::string | get_message () |
Get the log message. More... | |
LOGTYPE | get_log_type () |
Get the log message type. More... | |
msg_vec_it | get_msg_vec_begin () |
Returns a constant iterator pointing the begin of the message vector. More... | |
msg_vec_it | get_msg_vec_end () |
Returns a constant iterator pointing the end of the message vector. More... | |
std::string | get_call_file () |
Return file from where this log message was issued. More... | |
int | get_call_file_line () |
Return line number in file from where this log message was issued. More... | |
std::string | get_call_func () |
Return function name from where this log message was issued. More... | |
Log message struct.
A log message in ealogger stores lots of information besides the message string a user has provided.
First of all there are two types of messages in ealogger. LogMessage::LOGTYPE has two members. STACK messages are messages that are containing a stacktrace.
Additionally a LogMessage stores the message severity, the file from where the message was issued as well as the line number and the function name. All these properties are exposed with appropriate getter functions.
The LOGTYPE enum stands for the LogMessage type.
Enumerator | |
---|---|
DEFAULT |
Normal log message |
STACK |
Log message with a vector of stack elements |
|
inline |
Initializes a log message object.
severity | Severity of the message |
message | Message as std::string |
log_type | LogMessage::LOGTYPE |
file | File from where this log message was issued |
lnumber | Line number in file from where this log message was issued |
func | Function from where this log message was issued |
|
inline |
Initializes a log message object with a vector of message strings.
severity | Severity of the message |
message_vec | A vector<std::string> containing the stack elements |
log_type | LogMessage::LOGTYPE |
file | File from where this log message was issued |
lnumber | Line number in file from where this log message was issued |
func | Function from where this log message was issued |
|
inline |
Return file from where this log message was issued.
|
inline |
Return line number in file from where this log message was issued.
|
inline |
Return function name from where this log message was issued.
|
inline |
Get the log message type.
|
inline |
Get the log message.
|
inline |
Returns a constant iterator pointing the begin of the message vector.
|
inline |
Returns a constant iterator pointing the end of the message vector.
|
inline |
Returns the severity of the message.
|
inline |
Return the time_point when this message was created.