CCF
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations
logger.h File Reference
#include "ccf/ds/enum_formatter.h"
#include "ccf/ds/logger_level.h"
#include "ccf/threading/thread_ids.h"
#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <iostream>
#include <nlohmann/json.hpp>
#include <optional>
#include <sstream>
#include <type_traits>

Go to the source code of this file.

Classes

struct  ccf::logger::LogLine
 
class  ccf::logger::AbstractLogger
 
class  ccf::logger::JsonConsoleLogger
 
class  ccf::logger::TextConsoleLogger
 
class  ccf::logger::config
 
struct  ccf::logger::Out
 

Namespaces

namespace  ccf
 
namespace  ccf::logger
 

Macros

#define FMT_HEADER_ONLY
 
#define CCF_FMT_STRING(s)   FMT_STRING(s)
 
#define CCF_LOG_OUT(LVL, TAG)
 
#define CCF_LOG_FMT_2(s, ...)   fmt::format(CCF_FMT_STRING(s), ##__VA_ARGS__)
 
#define CCF_LOG_FMT(LVL, TAG)   CCF_LOG_OUT(LVL, TAG) << CCF_LOG_FMT_2
 
#define CCF_LOGGER_DEPRECATE(MACRO)   ccf::logger::macro::MACRO;
 
#define LOG_TRACE_FMT   CCF_LOGGER_DEPRECATE(LOG_TRACE_FMT) CCF_LOG_FMT(TRACE, "")
 
#define LOG_DEBUG_FMT   CCF_LOGGER_DEPRECATE(LOG_DEBUG_FMT) CCF_LOG_FMT(DEBUG, "")
 
#define CCF_APP_TRACE   CCF_LOG_FMT(TRACE, "app")
 
#define CCF_APP_DEBUG   CCF_LOG_FMT(DEBUG, "app")
 
#define LOG_INFO_FMT   CCF_LOGGER_DEPRECATE(LOG_INFO_FMT) CCF_LOG_FMT(INFO, "")
 
#define LOG_FAIL_FMT   CCF_LOGGER_DEPRECATE(LOG_FAIL_FMT) CCF_LOG_FMT(FAIL, "")
 
#define LOG_FATAL_FMT   CCF_LOGGER_DEPRECATE(LOG_FATAL_FMT) CCF_LOG_FMT(FATAL, "")
 
#define CCF_APP_INFO   CCF_LOG_FMT(INFO, "app")
 
#define CCF_APP_FAIL   CCF_LOG_FMT(FAIL, "app")
 
#define CCF_APP_FATAL   CCF_LOG_FMT(FATAL, "app")
 

Enumerations

enum class  ccf::logger::macro {
  ccf::logger::LOG_TRACE_FMT , ccf::logger::LOG_DEBUG_FMT , ccf::logger::LOG_INFO_FMT , ccf::logger::LOG_FAIL_FMT ,
  ccf::logger::LOG_FATAL_FMT
}
 

Macro Definition Documentation

◆ CCF_APP_DEBUG

#define CCF_APP_DEBUG   CCF_LOG_FMT(DEBUG, "app")

◆ CCF_APP_FAIL

#define CCF_APP_FAIL   CCF_LOG_FMT(FAIL, "app")

◆ CCF_APP_FATAL

#define CCF_APP_FATAL   CCF_LOG_FMT(FATAL, "app")

◆ CCF_APP_INFO

#define CCF_APP_INFO   CCF_LOG_FMT(INFO, "app")

◆ CCF_APP_TRACE

#define CCF_APP_TRACE   CCF_LOG_FMT(TRACE, "app")

◆ CCF_FMT_STRING

#define CCF_FMT_STRING (   s)    FMT_STRING(s)

◆ CCF_LOG_FMT

#define CCF_LOG_FMT (   LVL,
  TAG 
)    CCF_LOG_OUT(LVL, TAG) << CCF_LOG_FMT_2

◆ CCF_LOG_FMT_2

#define CCF_LOG_FMT_2 (   s,
  ... 
)    fmt::format(CCF_FMT_STRING(s), ##__VA_ARGS__)

◆ CCF_LOG_OUT

#define CCF_LOG_OUT (   LVL,
  TAG 
)
Value:
ccf::logger::config::ok(ccf::LoggerLevel::LVL) && \
ccf::logger::Out() == \
ccf::logger::LogLine(ccf::LoggerLevel::LVL, TAG, __FILE__, __LINE__)
static bool ok(LoggerLevel l)
Definition logger.h:282

◆ CCF_LOGGER_DEPRECATE

#define CCF_LOGGER_DEPRECATE (   MACRO)    ccf::logger::macro::MACRO;

◆ FMT_HEADER_ONLY

#define FMT_HEADER_ONLY

◆ LOG_DEBUG_FMT

#define LOG_DEBUG_FMT   CCF_LOGGER_DEPRECATE(LOG_DEBUG_FMT) CCF_LOG_FMT(DEBUG, "")

◆ LOG_FAIL_FMT

#define LOG_FAIL_FMT   CCF_LOGGER_DEPRECATE(LOG_FAIL_FMT) CCF_LOG_FMT(FAIL, "")

◆ LOG_FATAL_FMT

#define LOG_FATAL_FMT   CCF_LOGGER_DEPRECATE(LOG_FATAL_FMT) CCF_LOG_FMT(FATAL, "")

◆ LOG_INFO_FMT

#define LOG_INFO_FMT   CCF_LOGGER_DEPRECATE(LOG_INFO_FMT) CCF_LOG_FMT(INFO, "")

◆ LOG_TRACE_FMT

#define LOG_TRACE_FMT   CCF_LOGGER_DEPRECATE(LOG_TRACE_FMT) CCF_LOG_FMT(TRACE, "")