Loading...
Searching...
No Matches
EonLogger.h File Reference
#include "quill/Backend.h"
#include "quill/Frontend.h"
#include "quill/LogMacros.h"
#include "quill/Logger.h"
#include "quill/sinks/ConsoleSink.h"
#include "quill/sinks/FileSink.h"
#include <atomic>
#include <filesystem>
#include <mutex>
#include <source_location>
#include <string>
#include <string_view>
#include <system_error>

Go to the source code of this file.

Classes

struct  eonc::log::Scoped
 RAII helper for class-scoped logging. More...
struct  eonc::log::FileScoped
 RAII helper for file-based logging in a class. More...

Namespaces

namespace  eonc
 RAII resource manager for the ARTn C library with global synchronization.
namespace  eonc::log
namespace  eonc::log::detail

Macros

#define EONC_EXPAND(x)
#define EONC_LOG_TRACE(...)
 Convenience macro for one-shot logging without storing a logger.
#define EONC_LOG_DEBUG(...)
#define EONC_LOG_INFO(...)
#define EONC_LOG_WARNING(...)
#define EONC_LOG_ERROR(...)
#define EONC_LOG_CRITICAL(...)

Functions

quill::Logger * eonc::log::get () noexcept
 Get or create the default "combi" logger.
quill::Logger * eonc::log::traceback () noexcept
 Get or create the "_traceback" logger for traceback logging.
quill::Logger * eonc::log::get_file (std::string_view name, std::string_view filename, std::string_view pattern="%(message)")
 Get or create a named logger with a file sink.

Variables

constexpr std::string_view eonc::log::detail::kDefaultLoggerName {"combi"}
constexpr std::string_view eonc::log::detail::kTracebackLoggerName {"_traceback"}

Macro Definition Documentation

◆ EONC_EXPAND

#define EONC_EXPAND ( x)
Value:
x

Definition at line 227 of file EonLogger.h.

◆ EONC_LOG_CRITICAL

#define EONC_LOG_CRITICAL ( ...)
Value:
do { \
if (auto *l = eonc::log::get()) { \
EONC_EXPAND(QUILL_LOG_CRITICAL(l, __VA_ARGS__)); \
} \
} while (0)
quill::Logger * get() noexcept
Get or create the default "combi" logger.
Definition EonLogger.h:44

Definition at line 267 of file EonLogger.h.

267#define EONC_LOG_CRITICAL(...) \
268 do { \
269 if (auto *l = eonc::log::get()) { \
270 EONC_EXPAND(QUILL_LOG_CRITICAL(l, __VA_ARGS__)); \
271 } \
272 } while (0)

◆ EONC_LOG_DEBUG

#define EONC_LOG_DEBUG ( ...)
Value:
do { \
if (auto *l = eonc::log::get()) { \
EONC_EXPAND(QUILL_LOG_DEBUG(l, __VA_ARGS__)); \
} \
} while (0)

Definition at line 243 of file EonLogger.h.

243#define EONC_LOG_DEBUG(...) \
244 do { \
245 if (auto *l = eonc::log::get()) { \
246 EONC_EXPAND(QUILL_LOG_DEBUG(l, __VA_ARGS__)); \
247 } \
248 } while (0)

◆ EONC_LOG_ERROR

#define EONC_LOG_ERROR ( ...)
Value:
do { \
if (auto *l = eonc::log::get()) { \
EONC_EXPAND(QUILL_LOG_ERROR(l, __VA_ARGS__)); \
} \
} while (0)

Definition at line 261 of file EonLogger.h.

261#define EONC_LOG_ERROR(...) \
262 do { \
263 if (auto *l = eonc::log::get()) { \
264 EONC_EXPAND(QUILL_LOG_ERROR(l, __VA_ARGS__)); \
265 } \
266 } while (0)

◆ EONC_LOG_INFO

#define EONC_LOG_INFO ( ...)
Value:
do { \
if (auto *l = eonc::log::get()) { \
EONC_EXPAND(QUILL_LOG_INFO(l, __VA_ARGS__)); \
} \
} while (0)

Definition at line 249 of file EonLogger.h.

249#define EONC_LOG_INFO(...) \
250 do { \
251 if (auto *l = eonc::log::get()) { \
252 EONC_EXPAND(QUILL_LOG_INFO(l, __VA_ARGS__)); \
253 } \
254 } while (0)

◆ EONC_LOG_TRACE

#define EONC_LOG_TRACE ( ...)
Value:
do { \
if (auto *l = eonc::log::get()) { \
EONC_EXPAND(QUILL_LOG_TRACE_L1(l, __VA_ARGS__)); \
} \
} while (0)

Convenience macro for one-shot logging without storing a logger.

Use when you only need to log once or twice in a function and don't want to declare a logger variable.

Example: EONC_LOG_INFO("quick message"); EONC_LOG_DEBUG("value: {}", x);

Definition at line 237 of file EonLogger.h.

237#define EONC_LOG_TRACE(...) \
238 do { \
239 if (auto *l = eonc::log::get()) { \
240 EONC_EXPAND(QUILL_LOG_TRACE_L1(l, __VA_ARGS__)); \
241 } \
242 } while (0)

◆ EONC_LOG_WARNING

#define EONC_LOG_WARNING ( ...)
Value:
do { \
if (auto *l = eonc::log::get()) { \
EONC_EXPAND(QUILL_LOG_WARNING(l, __VA_ARGS__)); \
} \
} while (0)

Definition at line 255 of file EonLogger.h.

255#define EONC_LOG_WARNING(...) \
256 do { \
257 if (auto *l = eonc::log::get()) { \
258 EONC_EXPAND(QUILL_LOG_WARNING(l, __VA_ARGS__)); \
259 } \
260 } while (0)