    

 ## On this page

  

 

 # ansys::dpf::core::logging::Logger Class Reference

 Last update: 16.07.2025 

[Logger](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.") interface. All public methods are thread-safe. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#details)

`#include <dpf_api.h>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

bool [valid](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#af93f29066aead589c32ad6f0fa38e331) () 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](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.") 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](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.") is invalid, all method calls like [flush()](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a8a32ca508e5afd4f884a837e89e0b630 "Flush all logger messages to the active sinks.") or [log()](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#aa2e49a144e585dacee844c661aa64259 "Logs a message with the critical loglevel.") will be NOPs. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#af93f29066aead589c32ad6f0fa38e331)  
 std::string [name](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a3feaa521731b1300642dbe3f66ec730e) () const Return the name of the [Logger](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe."). [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a3feaa521731b1300642dbe3f66ec730e)  
 <a id="a8a32ca508e5afd4f884a837e89e0b630" name="a8a32ca508e5afd4f884a837e89e0b630"></a>void **flush** () Flush all logger messages to the active sinks.   
 template&lt;typename T &gt; void [trace](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#aebee92154360756451a040db2baf0e44) (T const &amp;message) Logs a message with the trace loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#aebee92154360756451a040db2baf0e44)  
 template&lt;typename T &gt; void [debug](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a0d6afc34b35d16aced0f7ab7e7c0e44d) (T const &amp;message) Logs a message with the debug loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a0d6afc34b35d16aced0f7ab7e7c0e44d)  
 template&lt;typename T &gt; void [info](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a6f6a31f9750e3edddc5e7c2df1e68ccc) (T const &amp;message) Logs a message with the info loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a6f6a31f9750e3edddc5e7c2df1e68ccc)  
 template&lt;typename T &gt; void [warning](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a445d9fc717e79f90fa375e681ad73bb5) (T const &amp;message) Logs a message with the warning loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a445d9fc717e79f90fa375e681ad73bb5)  
 template&lt;typename T &gt; void [error](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a043296791982c6c29b84e57bd40b3dab) (T const &amp;message) Logs a message with the error loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a043296791982c6c29b84e57bd40b3dab)  
 template&lt;typename T &gt; void [critical](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a3c0ae4ad90cb6e940d9d9fce2d51eded) (T const &amp;message) Logs a message with the critical loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a3c0ae4ad90cb6e940d9d9fce2d51eded)  
 template&lt;typename T &gt; void [log](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#aa2e49a144e585dacee844c661aa64259) (T const &amp;message, eLogLevel loglevel) Logs a message with the critical loglevel. [More...](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#aa2e49a144e585dacee844c661aa64259)  
 <a id="details" name="details"></a>## Detailed Description

[Logger](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.") interface. All public methods are thread-safe.



## Member Function Documentation

<a id="a3c0ae4ad90cb6e940d9d9fce2d51eded" name="a3c0ae4ad90cb6e940d9d9fce2d51eded"></a>## [◆ ](#a3c0ae4ad90cb6e940d9d9fce2d51eded)critical()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::critical  ( T const &amp;  *message*)   inline 

Logs a message with the critical loglevel.

Parameters messageThe string to be logged. 



<a id="a0d6afc34b35d16aced0f7ab7e7c0e44d" name="a0d6afc34b35d16aced0f7ab7e7c0e44d"></a>## [◆ ](#a0d6afc34b35d16aced0f7ab7e7c0e44d)debug()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::debug  ( T const &amp;  *message*)   inline 

Logs a message with the debug loglevel.

Parameters messageThe string to be logged. 



<a id="a043296791982c6c29b84e57bd40b3dab" name="a043296791982c6c29b84e57bd40b3dab"></a>## [◆ ](#a043296791982c6c29b84e57bd40b3dab)error()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::error  ( T const &amp;  *message*)   inline 

Logs a message with the error loglevel.

Parameters messageThe string to be logged. 



<a id="a6f6a31f9750e3edddc5e7c2df1e68ccc" name="a6f6a31f9750e3edddc5e7c2df1e68ccc"></a>## [◆ ](#a6f6a31f9750e3edddc5e7c2df1e68ccc)info()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::info  ( T const &amp;  *message*)   inline 

Logs a message with the info loglevel.

Parameters messageThe string to be logged. 



<a id="aa2e49a144e585dacee844c661aa64259" name="aa2e49a144e585dacee844c661aa64259"></a>## [◆ ](#aa2e49a144e585dacee844c661aa64259)log()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::log  ( T const &amp;  *message*,    eLogLevel  *loglevel*   )   inline 

Logs a message with the critical loglevel.

Parameters messageThe string to be logged. 



<a id="a3feaa521731b1300642dbe3f66ec730e" name="a3feaa521731b1300642dbe3f66ec730e"></a>## [◆ ](#a3feaa521731b1300642dbe3f66ec730e)name()

 std::string ansys::dpf::core::logging::Logger::name  ( )  const

Return the name of the [Logger](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.").

Returnsstd::string 



<a id="aebee92154360756451a040db2baf0e44" name="aebee92154360756451a040db2baf0e44"></a>## [◆ ](#aebee92154360756451a040db2baf0e44)trace()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::trace  ( T const &amp;  *message*)   inline 

Logs a message with the trace loglevel.

Parameters messageThe string to be logged. 



<a id="af93f29066aead589c32ad6f0fa38e331" name="af93f29066aead589c32ad6f0fa38e331"></a>## [◆ ](#af93f29066aead589c32ad6f0fa38e331)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](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.") 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](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml "Logger interface. All public methods are thread-safe.") is invalid, all method calls like [flush()](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#a8a32ca508e5afd4f884a837e89e0b630 "Flush all logger messages to the active sinks.") or [log()](classansys_1_1dpf_1_1core_1_1logging_1_1Logger.xhtml#aa2e49a144e585dacee844c661aa64259 "Logs a message with the critical loglevel.") will be NOPs.

Returnsstd::string 



<a id="a445d9fc717e79f90fa375e681ad73bb5" name="a445d9fc717e79f90fa375e681ad73bb5"></a>## [◆ ](#a445d9fc717e79f90fa375e681ad73bb5)warning()

template&lt;typename T &gt; 

 void ansys::dpf::core::logging::Logger::warning  ( T const &amp;  *message*)   inline 

Logs a message with the warning loglevel.

Parameters messageThe string to be logged.