Logger.h File Reference

This class is designed to manage the log of information in TerraLib. More...

#include "../Config.h"
#include "../utils/Platform.h"
#include "../../BuildConfig.h"

Go to the source code of this file.

Classes

class  te::core::Logger
 

Namespaces

 te
 URI C++ Library.
 
 te::core
 

Macros

#define CURRENT_FUNCTION   std::string(__FUNCTION__)
 
#define TE_ADD_LOGGER(name, filename, format)   ((void)0)
 Use this tag to init a logger using a default implementation without a configuration file. More...
 
#define TE_ADD_LOGGER_FROM_FILE(filename)   ((void)0)
 Use this tag to init a logger using a configuration file. More...
 
#define TE_CORE_LOG_DEBUG(channel, message)   ((void)0)
 Use this tag in order to log a message to a specified logger with the DEBUG level. More...
 
#define TE_CORE_LOG_ERROR(channel, message)   ((void)0)
 Use this tag in order to log a message to a specified logger with the ERROR level. More...
 
#define TE_CORE_LOG_FATAL(channel, message)   ((void)0)
 Use this tag in order to log a message to a specified logger with the FATAL level. More...
 
#define TE_CORE_LOG_INFO(channel, message)   ((void)0)
 Use this tag in order to log a message to a specified logger with the INFO level. More...
 
#define TE_CORE_LOG_TRACE(channel, message)   ((void)0)
 Use this tag in order to log a message to a specified logger with the TRACE level. More...
 
#define TE_CORE_LOG_WARN(channel, message)   ((void)0)
 Use this tag in order to log a message to a specified logger with the WARN level. More...
 
#define TE_INIT_DEFAULT_LOGGER(filename)   ((void)0)
 Use this tag in order to initialize the default TerraLib logger. More...
 
#define TE_LOG_DEBUG(message)   TE_CORE_LOG_DEBUG(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)
 Use this tag in order to log a message to the TerraLib default logger with the DEBUG level. More...
 
#define TE_LOG_ERROR(message)   TE_CORE_LOG_ERROR(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)
 Use this tag in order to log a message to the TerraLib default logger with the ERROR level. More...
 
#define TE_LOG_FATAL(message)   TE_CORE_LOG_FATAL(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)
 Use this tag in order to log a message to the TerraLib default logger with the FATAL level. More...
 
#define TE_LOG_INFO(message)   TE_CORE_LOG_INFO(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)
 Use this tag in order to log a message to the TerraLib default logger with the INFO level. More...
 
#define TE_LOG_TRACE(message)   TE_CORE_LOG_TRACE(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)
 Use this tag in order to log a message to the TerraLib default logger with the TRACE level. More...
 
#define TE_LOG_WARN(message)   TE_CORE_LOG_WARN(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)
 Use this tag in order to log a message to the TerraLib default logger with the WARN level. More...
 

Variables

const std::string TERRALIB_DEFAULT_LOGGER = "terralib"
 The default name of the log file if none is informed. More...
 
const std::string TERRALIB_DEFAULT_LOGGER_FORMAT = "[%TimeStamp%] <%Severity%> %Message%"
 The default message format if none is informed. More...
 

Detailed Description

This class is designed to manage the log of information in TerraLib.

Author
Matheus Cavassan Zaglia
Gilberto Ribeiro de Queiroz

Definition in file Logger.h.

Macro Definition Documentation

#define CURRENT_FUNCTION   std::string(__FUNCTION__)

Definition at line 40 of file Logger.h.

#define TE_ADD_LOGGER (   name,
  filename,
  format 
)    ((void)0)

Use this tag to init a logger using a default implementation without a configuration file.

Parameters
nameThe name of the logger.
filenameThe name of the log file.
formatThe format string of the logger.

Definition at line 169 of file Logger.h.

#define TE_ADD_LOGGER_FROM_FILE (   filename)    ((void)0)

Use this tag to init a logger using a configuration file.

Parameters
nameThe name of the logger.
filenameThe name of the configuration file.
Exceptions
std::exceptionIf the configuration file is doesn't load.

Definition at line 185 of file Logger.h.

#define TE_CORE_LOG_DEBUG (   channel,
  message 
)    ((void)0)

Use this tag in order to log a message to a specified logger with the DEBUG level.

Parameters
channelThe name of your logger.
messageThe message to be logged.

Definition at line 226 of file Logger.h.

#define TE_CORE_LOG_ERROR (   channel,
  message 
)    ((void)0)

Use this tag in order to log a message to a specified logger with the ERROR level.

Parameters
channelThe name of your logger.
messageThe message to be logged.

Definition at line 268 of file Logger.h.

#define TE_CORE_LOG_FATAL (   channel,
  message 
)    ((void)0)

Use this tag in order to log a message to a specified logger with the FATAL level.

Parameters
channelThe name of your logger.
messageThe message to be logged.

Definition at line 282 of file Logger.h.

#define TE_CORE_LOG_INFO (   channel,
  message 
)    ((void)0)

Use this tag in order to log a message to a specified logger with the INFO level.

Parameters
channelThe name of your logger.
messageThe message to be logged.

Definition at line 240 of file Logger.h.

#define TE_CORE_LOG_TRACE (   channel,
  message 
)    ((void)0)

Use this tag in order to log a message to a specified logger with the TRACE level.

Parameters
channelThe name of your logger.
messageThe message to be logged.

Definition at line 212 of file Logger.h.

#define TE_CORE_LOG_WARN (   channel,
  message 
)    ((void)0)

Use this tag in order to log a message to a specified logger with the WARN level.

Parameters
channelThe name of your logger.
messageThe message to be logged.

Definition at line 254 of file Logger.h.

#define TE_INIT_DEFAULT_LOGGER (   filename)    ((void)0)

Use this tag in order to initialize the default TerraLib logger.

Parameters
filenameThe name of the log file.

Definition at line 198 of file Logger.h.

#define TE_LOG_DEBUG (   message)    TE_CORE_LOG_DEBUG(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)

Use this tag in order to log a message to the TerraLib default logger with the DEBUG level.

Parameters
messageThe message to be logged.
Note
The DEBUG Level designates fine-grained informational events that are most useful to debug an application.

Definition at line 305 of file Logger.h.

#define TE_LOG_ERROR (   message)    TE_CORE_LOG_ERROR(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)

Use this tag in order to log a message to the TerraLib default logger with the ERROR level.

Parameters
messageThe message to be logged.
Note
The ERROR level designates error events that might still allow the application to continue running.

Definition at line 338 of file Logger.h.

#define TE_LOG_FATAL (   message)    TE_CORE_LOG_FATAL(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)

Use this tag in order to log a message to the TerraLib default logger with the FATAL level.

Parameters
messageThe message to be logged.
Note
The FATAL level designates very severe error events that will presumably lead the application to abort.

Definition at line 349 of file Logger.h.

#define TE_LOG_INFO (   message)    TE_CORE_LOG_INFO(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)

Use this tag in order to log a message to the TerraLib default logger with the INFO level.

Parameters
messageThe message to be logged.
Note
The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.

Definition at line 316 of file Logger.h.

#define TE_LOG_TRACE (   message)    TE_CORE_LOG_TRACE(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)

Use this tag in order to log a message to the TerraLib default logger with the TRACE level.

Parameters
messageThe message to be logged.
Note
The TRACE Level designates finer-grained informational events than the DEBUG.

Definition at line 294 of file Logger.h.

#define TE_LOG_WARN (   message)    TE_CORE_LOG_WARN(TERRALIB_DEFAULT_LOGGER, CURRENT_FUNCTION + " : " + message)

Use this tag in order to log a message to the TerraLib default logger with the WARN level.

Parameters
messageThe message to be logged.
Note
The WARN level designates potentially harmful situations.

Definition at line 327 of file Logger.h.

Referenced by te::rst::PolygonIterator< T >::setNextLine().

Variable Documentation

const std::string TERRALIB_DEFAULT_LOGGER = "terralib"

The default name of the log file if none is informed.

Definition at line 48 of file Logger.h.

const std::string TERRALIB_DEFAULT_LOGGER_FORMAT = "[%TimeStamp%] <%Severity%> %Message%"

The default message format if none is informed.

Definition at line 53 of file Logger.h.