From db23fa7736c706e05b39fa5ddc35af2e3089b75c Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Thu, 27 Jan 2022 17:15:34 +0100 Subject: chore: log --- docs/logging-configuration.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/logging-configuration.md b/docs/logging-configuration.md index d2c6276..c0cc64a 100644 --- a/docs/logging-configuration.md +++ b/docs/logging-configuration.md @@ -4,6 +4,26 @@ tableofcontents: 1 # Logging Configuration (log4j-like) +## Setting up logging in the core + +```cpp +LOG_TYPE("appender", "LOG MESSAGE {}", var); + +// Example +LOG_ERROR("sql.sql", "Unable to load creature entry {} and spawnId {}", entry, guid); +``` + +To pass any argument into the LOG MESSAGE use curly brackets, which uses FMT format to take any arguments and pass them into the LOG. + +| Type | +| :---- | +| FATAL | +| ERROR | +| WARN | +| INFO | +| DEBUG | +| TRACE | + ## Loggers and Appenders Logging system has two components: loggers and appenders. These types of components enable users to log messages according to message type and level and control at runtime where they are reported. -- cgit