diff options
| author | 2022-05-02 12:43:30 +0100 | |
|---|---|---|
| committer | 2022-05-02 12:43:30 +0100 | |
| commit | 7b40edc9af91beb3ea47990a6dd4ceaad512d8eb (patch) | |
| tree | f51da54869090f1d028090de7e9b2755b140fb3d /src/logging.cpp | |
| parent | Kill an unnecessary accessibility keyword. (diff) | |
| download | inspircd++-7b40edc9af91beb3ea47990a6dd4ceaad512d8eb.tar.gz inspircd++-7b40edc9af91beb3ea47990a6dd4ceaad512d8eb.tar.bz2 inspircd++-7b40edc9af91beb3ea47990a6dd4ceaad512d8eb.zip | |
Add a log method for stringifying a logging method.
Diffstat (limited to 'src/logging.cpp')
| -rw-r--r-- | src/logging.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index 8aaa81104..37a38fae6 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -19,6 +19,30 @@ #include "inspircd.h" +const char* Log::LevelToString(Log::Level level) +{ + switch (level) + { + case Log::Level::ERROR: + return "error"; + + case Log::Level::WARNING: + return "warning"; + + case Log::Level::NORMAL: + return "normal"; + + case Log::Level::DEBUG: + return "debug"; + + case Log::Level::RAWIO: + return "rawio"; + } + + // Should never happen. + return "unknown"; +} + Log::FileMethod::FileMethod(const std::string& n, FILE* fh, unsigned long fl, bool ac) : autoclose(ac) , file(fh) |
