lintel 0.2.0
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations
LoggerService.h File Reference
#include <cstdint>
#include <format>
#include <memory>
#include <mutex>
#include <string_view>
#include "lintel/core/models/ProcessName.h"

Go to the source code of this file.

Classes

class  lintel::LoggerService
 

Namespaces

namespace  lintel
 
namespace  spdlog
 

Macros

#define LINTEL_FUNCTION   __func__
 
#define DECLARE_LOGGER(processName, configuration)   lintel::LoggerService::getOrCreate(processName, configuration)
 
#define LOG_INFO(message, ...)    lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::info, message, ##__VA_ARGS__)
 
#define LOG_DEBUG(message, ...)    lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::debug, message, ##__VA_ARGS__)
 
#define LOG_TRACE(message, ...)    lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::trace, message, ##__VA_ARGS__)
 
#define LOG_ERROR(message, ...)    lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::error, message, ##__VA_ARGS__)
 
#define LOG_FATAL(message, ...)
 
#define LOG_WARN(message, ...)    lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::warn, message, ##__VA_ARGS__)
 

Enumerations

enum class  lintel::LogLevel : std::uint8_t {
  lintel::trace = 0 , lintel::debug = 1 , lintel::info = 2 , lintel::warn = 3 ,
  lintel::error = 4 , lintel::critical = 5 , lintel::off = 6
}
 

Macro Definition Documentation

◆ DECLARE_LOGGER

#define DECLARE_LOGGER (   processName,
  configuration 
)    lintel::LoggerService::getOrCreate(processName, configuration)

◆ LINTEL_FUNCTION

#define LINTEL_FUNCTION   __func__

Source location function name for the LOG_* macros, equivalent to spdlog's SPDLOG_FUNCTION.

◆ LOG_DEBUG

#define LOG_DEBUG (   message,
  ... 
)     lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::debug, message, ##__VA_ARGS__)

◆ LOG_ERROR

#define LOG_ERROR (   message,
  ... 
)     lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::error, message, ##__VA_ARGS__)

◆ LOG_FATAL

#define LOG_FATAL (   message,
  ... 
)
Value:
__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::critical, message, ##__VA_ARGS__)
#define LINTEL_FUNCTION
Definition LoggerService.h:44
static LoggerService & get()
void log(const char *file, int line, const char *function, LogLevel lvl, std::string_view message, Args &&...args)
Definition LoggerService.h:117

◆ LOG_INFO

#define LOG_INFO (   message,
  ... 
)     lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::info, message, ##__VA_ARGS__)

◆ LOG_TRACE

#define LOG_TRACE (   message,
  ... 
)     lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::trace, message, ##__VA_ARGS__)

◆ LOG_WARN

#define LOG_WARN (   message,
  ... 
)     lintel::LoggerService::get().log(__FILE__, __LINE__, LINTEL_FUNCTION, lintel::LogLevel::warn, message, ##__VA_ARGS__)