Dev Essential  1.6.3
Loading...
Searching...
No Matches
log.h File Reference
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  a_util::logging::LogEntry
 A log entry. More...
 

Namespaces

namespace  a_util
 Serves as the root component, with common functionality documented in core functionality.
 
namespace  a_util::logging
 Serves as component for basic logging functionality.
 

Macros

#define LOG_ADD_ENTRY(__level, ...)
 
#define LOG_DUMP(...)
 
#define LOG_INFO(...)
 Log a message with LogLevel Info.
 
#define LOG_WARNING(...)
 
#define LOG_ERROR(...)
 

Typedefs

typedef experimental::UnaryDelegate< void, const LogEntry & > a_util::logging::Logger
 

Enumerations

enum  a_util::logging::LogLevel {
  a_util::logging::None = 0 , a_util::logging::Error = 10 , a_util::logging::Warning = 20 , a_util::logging::Info = 30 ,
  a_util::logging::Dump = 40 , a_util::logging::Debug = Dump , a_util::logging::All = 0xFF
}
 

Functions

void a_util::logging::addEntry (const LogEntry &entry)
 
void a_util::logging::addEntry (std::uint8_t log_level, const std::string &message=a_util::strings::empty_string, const std::string &source=a_util::strings::empty_string)
 
void a_util::logging::setLogger (Logger log)
 
Logger a_util::logging::getLogger ()
 
std::string a_util::logging::defaultFormat (const LogEntry &entry)
 
void a_util::logging::defaultLogger (const LogEntry &entry)
 

Detailed Description

Public API for Logger type, functions and macros

Macro Definition Documentation

◆ LOG_ADD_ENTRY

#define LOG_ADD_ENTRY ( __level,
... )
Value:
a_util::strings::format(__VA_ARGS__), \
__FILE__ "(" A_UTIL_TO_STRING(__LINE__) ")")
#define A_UTIL_TO_STRING(expression)
Definition to_string.h:31
void addEntry(const LogEntry &entry)
std::string format(const char *str_format,...)

Add a log entry to the current logger, including current filename and line number

Parameters
[in]__levelThe log level
[in]...Arguments forwarded to printf()-like formatting

◆ LOG_DUMP

#define LOG_DUMP ( ...)

Log a message with LogLevel Dump (only in Debug mode)

◆ LOG_ERROR

#define LOG_ERROR ( ...)
Value:
#define LOG_ADD_ENTRY(__level,...)
Definition log.h:100
@ Error
Log errors only.
Definition log.h:32

Log a message with LogLevel Error

◆ LOG_INFO

#define LOG_INFO ( ...)
Value:
@ Info
Log errors, warnings and info messages.
Definition log.h:34

Log a message with LogLevel Info.

◆ LOG_WARNING

#define LOG_WARNING ( ...)
Value:
@ Warning
Log errors and warnings.
Definition log.h:33

Log a message with LogLevel Warning