ansys::dpf::core::logging::Logger Class Reference
Last update: 16.07.2025Logger interface. All public methods are thread-safe. More...
#include <dpf_api.h>
Public Member Functions | |
| bool | valid () const |
| Returns if the logger is valid. By design, the logging API will never error and there could be situations where a non-functional Logger instance will be returned. E.g if trying to register a logger with a name that is already registered or with an invalid name, or get a logger with a name which does not exist or is invalid. If the Logger is invalid, all method calls like flush() or log() will be NOPs. More... | |
| std::string | name () const |
| Return the name of the Logger. More... | |
| void | flush () |
| Flush all logger messages to the active sinks. | |
| template<typename T > | |
| void | trace (T const &message) |
| Logs a message with the trace loglevel. More... | |
| template<typename T > | |
| void | debug (T const &message) |
| Logs a message with the debug loglevel. More... | |
| template<typename T > | |
| void | info (T const &message) |
| Logs a message with the info loglevel. More... | |
| template<typename T > | |
| void | warning (T const &message) |
| Logs a message with the warning loglevel. More... | |
| template<typename T > | |
| void | error (T const &message) |
| Logs a message with the error loglevel. More... | |
| template<typename T > | |
| void | critical (T const &message) |
| Logs a message with the critical loglevel. More... | |
| template<typename T > | |
| void | log (T const &message, eLogLevel loglevel) |
| Logs a message with the critical loglevel. More... | |
Detailed Description
Logger interface. All public methods are thread-safe.
Member Function Documentation
◆ critical()
|
inline |
Logs a message with the critical loglevel.
- Parameters
-
message The string to be logged.
◆ debug()
|
inline |
Logs a message with the debug loglevel.
- Parameters
-
message The string to be logged.
◆ error()
|
inline |
Logs a message with the error loglevel.
- Parameters
-
message The string to be logged.
◆ info()
|
inline |
Logs a message with the info loglevel.
- Parameters
-
message The string to be logged.
◆ log()
|
inline |
Logs a message with the critical loglevel.
- Parameters
-
message The string to be logged.
◆ name()
| std::string ansys::dpf::core::logging::Logger::name | ( | ) | const |
Return the name of the Logger.
- Returns
- std::string
◆ trace()
|
inline |
Logs a message with the trace loglevel.
- Parameters
-
message The string to be logged.
◆ valid()
| bool ansys::dpf::core::logging::Logger::valid | ( | ) | const |
Returns if the logger is valid. By design, the logging API will never error and there could be situations where a non-functional Logger instance will be returned. E.g if trying to register a logger with a name that is already registered or with an invalid name, or get a logger with a name which does not exist or is invalid. If the Logger is invalid, all method calls like flush() or log() will be NOPs.
- Returns
- std::string
◆ warning()
|
inline |
Logs a message with the warning loglevel.
- Parameters
-
message The string to be logged.