The base class that derived target classes inherit from. Contains common functions between all targets for message logging and logging settings.
More...
|
| TargetBase () |
| Default constructor that sets the logger name to "Base_Target" and sets all other values to their defaults.
|
|
| TargetBase (std::string_view name) |
| Constructor that will set the logger name to the name paramater passed in and all other values to their defaults. More...
|
|
| TargetBase (std::string_view name, std::string_view msgPattern) |
| Constructor that will set the logger name to the name paramater passed in as well as the format pattern to the msgPattern passed in. All other values will be assigned their default values. More...
|
|
void | SetFlushPolicy (serenity::experimental::Flush_Policy pPolicy) |
| Sets the current policy in use to defer to the policy passed in from "pPolicy". More...
|
|
serenity::experimental::Flush_Policy & | Policy () |
| Returns the current policy in use.
|
|
const std::string | LoggerName () |
| Returns the logger's name.
|
|
void | SetPattern (std::string_view pattern) |
| Calls the handle to the Message_Formatter's SetPattern( ) function. More...
|
|
void | ResetPatternToDefault () |
| Resets the current format pattern in use to the default format pattern.
|
|
void | SetLogLevel (LoggerLevel level) |
| Sets the log level that messages should be logged at. More...
|
|
void | WriteToBaseBuffer (bool fmtToBuf=true) |
| Enables/Disables writing to a buffer. More...
|
|
bool | isWriteToBuf () |
| Returns true if buffer writes are enabled and false if they are disabled.
|
|
std::string * | Buffer () |
| Returns a pointer to the buffer container.
|
|
const LoggerLevel | Level () |
| Returns the current log level setting (the threshold of whether to log a message or not).
|
|
void | SetLoggerName (std::string_view name) |
| Sets the name of the logger. More...
|
|
template<typename... Args> |
void | Trace (std::string_view msg, Args &&...args) |
| Logs a message giving the message a LoggerLevel::trace setting. More...
|
|
template<typename... Args> |
void | Info (std::string_view msg, Args &&...args) |
| Logs a message giving the message a LoggerLevel::info setting. More...
|
|
template<typename... Args> |
void | Debug (std::string_view msg, Args &&...args) |
| Logs a message giving the message a LoggerLevel::debug setting. More...
|
|
template<typename... Args> |
void | Warn (std::string_view msg, Args &&...args) |
| Logs a message giving the message a LoggerLevel::warning setting. More...
|
|
template<typename... Args> |
void | Error (std::string_view msg, Args &&...args) |
| Logs a message giving the message a LoggerLevel::error setting. More...
|
|
template<typename... Args> |
void | Fatal (std::string_view msg, Args &&...args) |
| Logs a message giving the message a LoggerLevel::fatal setting. More...
|
|
For All TargetBase Constructors:
The following default values are set regardless of which constructor is used:
- Flush Policy is set to "never".
- Log Level is set to "LoggerLevel::trace".
- Default pattern is set to "|%l| %x %n %T [%N]: %+" which translates to the form of:
"|T| Sat 29Jan22 [Base_Logger]: The message to log".
- Time mode used is set to "time_mode::local".
template<typename... Args>
serenity::targets::TargetBase::Debug |
( |
std::string_view |
msg, |
|
|
Args &&... |
args |
|
) |
| |
Checks if the message should be logged via the log level threshold setting. If it isn't, immediately returns. If the message should be logged, this function will then perform a quick check on whether or not writes to the buffer were enabled and will write to the buffer if they were. If writes to the buffers weren't enabled, then PrintMessage( ) will be called and the derived target handles how this is implemented. After writing the message, follows the derived target's PolicyFlushOn( ) implementation
- Template Parameters
-
msg | The message being passed in. Follows C++20's format library and libfmt's substitution model using "{}" to replace any arguments from the args parameter. |
args | Variadic placeholder for any number of and any type of arguments to use in substituion. |
template<typename... Args>
serenity::targets::TargetBase::Error |
( |
std::string_view |
msg, |
|
|
Args &&... |
args |
|
) |
| |
Checks if the message should be logged via the log level threshold setting. If it isn't, immediately returns. If the message should be logged, this function will then perform a quick check on whether or not writes to the buffer were enabled and will write to the buffer if they were. If writes to the buffers weren't enabled, then PrintMessage( ) will be called and the derived target handles how this is implemented. After writing the message, follows the derived target's PolicyFlushOn( ) implementation
- Template Parameters
-
msg | The message being passed in. Follows C++20's format library and libfmt's substitution model using "{}" to replace any arguments from the args parameter. |
args | Variadic placeholder for any number of and any type of arguments to use in substituion. |
template<typename... Args>
serenity::targets::TargetBase::Fatal |
( |
std::string_view |
msg, |
|
|
Args &&... |
args |
|
) |
| |
Checks if the message should be logged via the log level threshold setting. If it isn't, immediately returns. If the message should be logged, this function will then perform a quick check on whether or not writes to the buffer were enabled and will write to the buffer if they were. If writes to the buffers weren't enabled, then PrintMessage( ) will be called and the derived target handles how this is implemented. After writing the message, follows the derived target's PolicyFlushOn( ) implementation
- Template Parameters
-
msg | The message being passed in. Follows C++20's format library and libfmt's substitution model using "{}" to replace any arguments from the args parameter. |
args | Variadic placeholder for any number of and any type of arguments to use in substituion. |
template<typename... Args>
serenity::targets::TargetBase::Info |
( |
std::string_view |
msg, |
|
|
Args &&... |
args |
|
) |
| |
Checks if the message should be logged via the log level threshold setting. If it isn't, immediately returns. If the message should be logged, this function will then perform a quick check on whether or not writes to the buffer were enabled and will write to the buffer if they were. If writes to the buffers weren't enabled, then PrintMessage( ) will be called and the derived target handles how this is implemented. After writing the message, follows the derived target's PolicyFlushOn( ) implementation
- Template Parameters
-
msg | The message being passed in. Follows C++20's format library and libfmt's substitution model using "{}" to replace any arguments from the args parameter. |
args | Variadic placeholder for any number of and any type of arguments to use in substituion. |
template<typename... Args>
serenity::targets::TargetBase::Trace |
( |
std::string_view |
msg, |
|
|
Args &&... |
args |
|
) |
| |
Checks if the message should be logged via the log level threshold setting. If it isn't, immediately returns. If the message should be logged, this function will then perform a quick check on whether or not writes to the buffer were enabled and will write to the buffer if they were. If writes to the buffers weren't enabled, then PrintMessage( ) will be called and the derived target handles how this is implemented. After writing the message, follows the derived target's PolicyFlushOn( ) implementation
- Template Parameters
-
msg | The message being passed in. Follows C++20's format library and libfmt's substitution model using "{}" to replace any arguments from the args parameter. |
args | Variadic placeholder for any number of and any type of arguments to use in substituion. |
template<typename... Args>
serenity::targets::TargetBase::Warn |
( |
std::string_view |
msg, |
|
|
Args &&... |
args |
|
) |
| |
Checks if the message should be logged via the log level threshold setting. If it isn't, immediately returns. If the message should be logged, this function will then perform a quick check on whether or not writes to the buffer were enabled and will write to the buffer if they were. If writes to the buffers weren't enabled, then PrintMessage( ) will be called and the derived target handles how this is implemented. After writing the message, follows the derived target's PolicyFlushOn( ) implementation
- Template Parameters
-
msg | The message being passed in. Follows C++20's format library and libfmt's substitution model using "{}" to replace any arguments from the args parameter. |
args | Variadic placeholder for any number of and any type of arguments to use in substituion. |