Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
wiki:documentation:devguide:core:logger [2016/10/04 10:34] carolina.santos [Default Logger] |
wiki:documentation:devguide:core:logger [2016/10/04 11:32] carolina.santos [C++] |
||
---|---|---|---|
Line 14: | Line 14: | ||
namespace core | namespace core | ||
{ | { | ||
- | class TECOREEXPORT Logger | + | class Logger |
{ | { | ||
/*! | /*! | ||
Line 107: | Line 107: | ||
* ''channel'': logger name. | * ''channel'': logger name. | ||
- | * ''message'': message to be registered. | + | * ''message'': message to be logged. |
It's possible to define your own logger macros, so that is not necessary to provide the logger name every time a log is made. | It's possible to define your own logger macros, so that is not necessary to provide the logger name every time a log is made. | ||
Line 151: | Line 151: | ||
</code> | </code> | ||
- | **Note:** the messages will be registered in the correct channel if the following filter was added: ''Filter="%Channel% matches \"logger_name\""'' | + | **Note:** the messages will be logged in the correct channel if the following filter was added: ''Filter="%Channel% matches \"logger_name\""'' |
The informations to create a configuration file are available in [[http://www.boost.org/doc/libs/1_60_0/libs/log/doc/html/index.html | Boost.Log]]. | The informations to create a configuration file are available in [[http://www.boost.org/doc/libs/1_60_0/libs/log/doc/html/index.html | Boost.Log]]. | ||
Line 165: | Line 165: | ||
Where: | Where: | ||
- | * ''filename'': file where the log messages will be registered. | + | * ''filename'': file where messages will be logged. |
The default logger of TerraLib consists of 6 macros that can be used to categorize messages in relevant levels: | The default logger of TerraLib consists of 6 macros that can be used to categorize messages in relevant levels: | ||
Line 191: | Line 191: | ||
</code> | </code> | ||
- | **Note:** watch out to the fact that should be avoided the use of macros like **TE_LOG_TRACE** and **TE_LOG_DEBUG** together with the message translation mechanism to avoid overhead involved in messages translation. | + | **Note:** be careful with the fact that the use of macros like **TE_LOG_TRACE** and **TE_LOG_DEBUG** together with the message translation mechanism should be avoided to prevent overhead involved in messages translation. |
The application and TerraLib must be compiled with the level **TE_LOG_TRACE** disabled to prevent overcharging with the log record in the archives. | The application and TerraLib must be compiled with the level **TE_LOG_TRACE** disabled to prevent overcharging with the log record in the archives. | ||
Line 203: | Line 203: | ||
* ''Channel'': logger name. | * ''Channel'': logger name. | ||
* ''Message'': message content. | * ''Message'': message content. | ||
- | * ''Process'': process that registered the message. | + | * ''Process'': process that logged the message. |
* ''ProcessID'': process id. | * ''ProcessID'': process id. | ||
- | * ''ThreadID'': id of the thread that registered the message. | + | * ''ThreadID'': id of the thread that logged the message. |
The attributes are used as follow: ''[%TimeStamp%] %Severity%: %Message%'' | The attributes are used as follow: ''[%TimeStamp%] %Severity%: %Message%'' |