bpf::log::Logger class

Utility to handle message logging

Constructors, destructors, conversion operators

Logger(String name) explicit
Logger(Logger&& other) noexcept
Logger(const Logger& other) deleted

Public functions

void SetLevel(const ELogLevel level)
auto operator=(Logger&& other) -> Logger& noexcept
auto operator=(const Logger& other) -> Logger& deleted
void AddHandler(memory::UniquePtr<ILogAdapter>&& ptr)
template<typename ... Args>
void Info(const String& format, Args && ... args)
template<typename ... Args>
void Debug(const String& format, Args && ... args)
template<typename ... Args>
void Warning(const String& format, Args && ... args)
template<typename ... Args>
void Error(const String& format, Args && ... args)

Function documentation

bpf::log::Logger::Logger(String name) explicit

Parameters
name the category name

Constructs a Logger

bpf::log::Logger::Logger(Logger&& other) noexcept

Move constructor

bpf::log::Logger::Logger(const Logger& other) deleted

Explicit deleted copy constructor (MSVC Fix: for some reasons MSVC is unable to identify this class cannot be coppied)

void bpf::log::Logger::SetLevel(const ELogLevel level)

Parameters
level the new maximum log level

Sets the maximum log level. All log messages that are greater than this level are ignored. The default is ELogLevel::DEBUG is debug builds and INFO in release builds

Logger& bpf::log::Logger::operator=(Logger&& other) noexcept

Move assignment operator

Logger& bpf::log::Logger::operator=(const Logger& other) deleted

Explicit deleted copy assignment operator (MSVC Fix: for some reasons MSVC is unable to identify this class cannot be coppied)

void bpf::log::Logger::AddHandler(memory::UniquePtr<ILogAdapter>&& ptr)

Parameters
ptr UniquePtr to the new ILogAdapter

Adds a new log adapter

template<typename ... Args>
void bpf::log::Logger::Info(const String& format, Args && ... args)

Template parameters
Args the type of arguments
Parameters
format the format (see bpf::String::Format for more information)
args the argument values

Logs an information message

template<typename ... Args>
void bpf::log::Logger::Debug(const String& format, Args && ... args)

Template parameters
Args the type of arguments
Parameters
format the format (see bpf::String::Format for more information)
args the argument values

Logs a debug message

template<typename ... Args>
void bpf::log::Logger::Warning(const String& format, Args && ... args)

Template parameters
Args the type of arguments
Parameters
format the format (see bpf::String::Format for more information)
args the argument values

Logs a warning message

template<typename ... Args>
void bpf::log::Logger::Error(const String& format, Args && ... args)

Template parameters
Args the type of arguments
Parameters
format the format (see bpf::String::Format for more information)
args the argument values

Logs an error message