oak - a modern logger 1.1.0
Loading...
Searching...
No Matches
oak Namespace Reference

Data Structures

class  FileWriter
 
class  Logger
 
class  StdoutWriter
 
class  Writer
 

Enumerations

enum class  Level {
  Debug = 0 , Info = 1 , Warn = 2 , Error = 3 ,
  Disabled = 4 , Default = Info
}
 
enum class  Flags : unsigned int {
  None = 0 , Level = 1 , Date = 1 << 1 , Time = 1 << 2 ,
  Pid = 1 << 3 , Tid = 1 << 4 , Json = 1 << 5 , Color = 1 << 6 ,
  File = 1 << 7 , Line = 1 << 8 , Default = Level
}
 

Functions

std::string level_to_string (enum Level level)
 
Loggerget_global ()
 
template<typename... Args>
static void log2 (enum oak::Level level, const char *file, int line, const char *fmt, Args &&...args)
 
template<typename... Args>
static void log (enum oak::Level level, const char *fmt, Args &&...args)
 
template<typename W , typename ... Args>
static void add_writer (Args &&...init_args)
 
static bool remove_writer (const std::string &name)
 
static enum Level get_level ()
 
static void set_level (enum Level level)
 
static unsigned int get_flags ()
 
template<typename ... F>
static void set_flags (F &&...flags)
 
template<typename ... F>
static void add_flags (F &&...flags)
 
static std::expected< int, std::string > load_config_file (const std::filesystem::path &file)
 
static void enable_event (unsigned int id, const std::string &name)
 
static void disable_event (unsigned int id)
 

Enumeration Type Documentation

◆ Flags

Enumerator
None 
Level 
Date 
Time 
Pid 
Tid 
Json 
Color 
File 
Line 
Default 

Definition at line 53 of file oak.hpp.

◆ Level

Enumerator
Debug 
Info 
Warn 
Error 
Disabled 
Default 

Definition at line 41 of file oak.hpp.

Function Documentation

◆ add_flags()

template<typename ... F>
static void oak::add_flags ( F &&...  flags)
inlinestatic

◆ add_writer()

template<typename W , typename ... Args>
static void oak::add_writer ( Args &&...  init_args)
inlinestatic

◆ disable_event()

static void oak::disable_event ( unsigned int  id)
inlinestatic

◆ enable_event()

static void oak::enable_event ( unsigned int  id,
const std::string &  name 
)
inlinestatic

◆ get_flags()

static unsigned int oak::get_flags ( )
inlinestatic

◆ get_global()

Logger & oak::get_global ( )

Definition at line 212 of file oak.cpp.

◆ get_level()

static enum Level oak::get_level ( )
inlinestatic

◆ level_to_string()

std::string oak::level_to_string ( enum Level  level)

Definition at line 10 of file oak.cpp.

◆ load_config_file()

static std::expected< int, std::string > oak::load_config_file ( const std::filesystem::path &  file)
inlinestatic

◆ log()

template<typename... Args>
static void oak::log ( enum oak::Level  level,
const char fmt,
Args &&...  args 
)
inlinestatic

◆ log2()

template<typename... Args>
static void oak::log2 ( enum oak::Level  level,
const char file,
int  line,
const char fmt,
Args &&...  args 
)
inlinestatic

◆ remove_writer()

static bool oak::remove_writer ( const std::string &  name)
inlinestatic

◆ set_flags()

template<typename ... F>
static void oak::set_flags ( F &&...  flags)
inlinestatic

◆ set_level()

static void oak::set_level ( enum Level  level)
inlinestatic