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 228 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 268 of file EonLogger.h.

268#define EONC_LOG_CRITICAL(...) \
269 do { \
270 if (auto *l = eonc::log::get()) { \
271 EONC_EXPAND(QUILL_LOG_CRITICAL(l, __VA_ARGS__)); \
272 } \
273 } 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 244 of file EonLogger.h.

244#define EONC_LOG_DEBUG(...) \
245 do { \
246 if (auto *l = eonc::log::get()) { \
247 EONC_EXPAND(QUILL_LOG_DEBUG(l, __VA_ARGS__)); \
248 } \
249 } 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 262 of file EonLogger.h.

262#define EONC_LOG_ERROR(...) \
263 do { \
264 if (auto *l = eonc::log::get()) { \
265 EONC_EXPAND(QUILL_LOG_ERROR(l, __VA_ARGS__)); \
266 } \
267 } 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 250 of file EonLogger.h.

250#define EONC_LOG_INFO(...) \
251 do { \
252 if (auto *l = eonc::log::get()) { \
253 EONC_EXPAND(QUILL_LOG_INFO(l, __VA_ARGS__)); \
254 } \
255 } 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 238 of file EonLogger.h.

238#define EONC_LOG_TRACE(...) \
239 do { \
240 if (auto *l = eonc::log::get()) { \
241 EONC_EXPAND(QUILL_LOG_TRACE_L1(l, __VA_ARGS__)); \
242 } \
243 } 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 256 of file EonLogger.h.

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