diff options
| author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2022-01-27 17:15:34 +0100 |
|---|---|---|
| committer | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2022-01-27 17:15:34 +0100 |
| commit | db23fa7736c706e05b39fa5ddc35af2e3089b75c (patch) | |
| tree | 0a7c01bacebfaceb013e329118e89a8d8973af83 | |
| parent | b52ea559291045f644fc1e1d217542f577676a96 (diff) | |
| download | wiki-db23fa7736c706e05b39fa5ddc35af2e3089b75c.tar.gz wiki-db23fa7736c706e05b39fa5ddc35af2e3089b75c.tar.bz2 wiki-db23fa7736c706e05b39fa5ddc35af2e3089b75c.zip | |
chore: log
| -rw-r--r-- | docs/logging-configuration.md | 20 |
1 files changed, 20 insertions, 0 deletions
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. |
