namespace ulog

Overview

namespace ulog {

// typedefs

typedef utils::StrongType<std::string, class Entry> Category;

// classes

class Entry;
class FileLogHandler;
class IgnorantHandler;
class LogHandler;
class PoolLogHandler;

// global variables

static const Category DEFAULT_CATEGORY { "Default" };

// global functions

UTILS_API void InstallHandler(const std::shared_ptr<LogHandler>& sink_to_use);
UTILS_API void ResetHandler();
UTILS_API void Debug(const std::string& msg, const std::string& caller = "");
UTILS_API void Info(const std::string& msg, const std::string& caller = "");
UTILS_API void Warn(const std::string& msg, const std::string& caller = "");
UTILS_API void Fail(const std::string& msg, const std::string& caller = "");
UTILS_API void Crash(const std::string& msg, const std::string& caller = "");
UTILS_API void DebugC(Category msg_category, const std::string& msg, const std::string& caller = "");
UTILS_API void InfoC(Category msg_category, const std::string& msg, const std::string& caller = "");
UTILS_API void WarnC(Category msg_category, const std::string& msg, const std::string& caller = "");
UTILS_API void FailC(Category msg_category, const std::string& msg, const std::string& caller = "");
UTILS_API void CrashC(Category msg_category, const std::string& msg, const std::string& caller = "");

} // namespace ulog

Detailed Documentation

Global Functions

UTILS_API void InstallHandler(const std::shared_ptr<LogHandler>& sink_to_use)

Replaces current log handler with the new one. By default, messages are logged to std::cerr.

UTILS_API void ResetHandler()

Replaces current log handler with the default one.

UTILS_API void Debug(const std::string& msg, const std::string& caller = "")

Creates a debug log message. Thread safe function.

UTILS_API void Info(const std::string& msg, const std::string& caller = "")

Creates an info log message. Thread safe function.

UTILS_API void Warn(const std::string& msg, const std::string& caller = "")

Creates a warning log message. Thread safe function.

UTILS_API void Fail(const std::string& msg, const std::string& caller = "")

Creates an error log message. Thread safe function.

UTILS_API void Crash(const std::string& msg, const std::string& caller = "")

Creates a critical log message. Thread safe function.

UTILS_API void DebugC(Category msg_category, const std::string& msg, const std::string& caller = "")

Creates a debug log message. Thread safe function.

UTILS_API void InfoC(Category msg_category, const std::string& msg, const std::string& caller = "")

Creates an info log message. Thread safe function.

UTILS_API void WarnC(Category msg_category, const std::string& msg, const std::string& caller = "")

Creates a warning log message. Thread safe function.

UTILS_API void FailC(Category msg_category, const std::string& msg, const std::string& caller = "")

Creates an error log message. Thread safe function.

UTILS_API void CrashC(Category msg_category, const std::string& msg, const std::string& caller = "")

Creates a critical log message. Thread safe function.