Saga
Saga Game Engine
Loading...
Searching...
No Matches
logger.h File Reference
#include "../defines.h"
#include <string>
Include dependency graph for logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Saga
 

Macros

#define LOG_WARN_ENABLED   1
 
#define LOG_INFO_ENABLED   1
 
#define LOG_DEBUG_ENABLED   1
 
#define LOG_TRACE_ENABLED   1
 
#define SFATAL(message, ...)   logOutput(Saga::LogLevel::FATAL, message, ##__VA_ARGS__)
 Log fatal-level messages.
 
#define SERROR(message, ...)   logOutput(Saga::LogLevel::ERROR, message, ##__VA_ARGS__)
 Log error-level messages.
 
#define SWARN(message, ...)   logOutput(Saga::LogLevel::WARN, message, ##__VA_ARGS__)
 Log warn-level messages.
 
#define SINFO(message, ...)   logOutput(Saga::LogLevel::INFO, message, ##__VA_ARGS__)
 Log info-level messages.
 
#define SDEBUG(message, ...)   logOutput(Saga::LogLevel::DEBUG, message, ##__VA_ARGS__)
 Log debug-level messages.
 
#define STRACE(message, ...)   logOutput(Saga::LogLevel::TRACE, message, ##__VA_ARGS__)
 Log trace-level messages.
 

Enumerations

enum  Saga::LogLevel {
  Saga::FATAL = 0 , Saga::ERROR = 1 , Saga::WARN = 2 , Saga::INFO = 3 ,
  Saga::DEBUG = 4 , Saga::TRACE = 5
}
 Define multiple levels of logging. Fatal and Error are always enabled, and debug and traced are left out of any build with SAGA_RELEASE defined. More...
 

Functions

bool Saga::initializeLogger ()
 Initialize the logger. Neccessary to call before any logging.
 
void Saga::logOutput (LogLevel level, const char *message,...)
 Log an output.
 
void Saga::shutDownLogger ()
 Shut down the logger, and flush any buffered output.
 

Macro Definition Documentation

◆ LOG_DEBUG_ENABLED

#define LOG_DEBUG_ENABLED   1

◆ LOG_INFO_ENABLED

#define LOG_INFO_ENABLED   1

◆ LOG_TRACE_ENABLED

#define LOG_TRACE_ENABLED   1

◆ LOG_WARN_ENABLED

#define LOG_WARN_ENABLED   1

◆ SDEBUG

#define SDEBUG (   message,
  ... 
)    logOutput(Saga::LogLevel::DEBUG, message, ##__VA_ARGS__)

Log debug-level messages.

Parameters
messageformatted string, similar to printf.

◆ SERROR

#define SERROR (   message,
  ... 
)    logOutput(Saga::LogLevel::ERROR, message, ##__VA_ARGS__)

Log error-level messages.

Parameters
messageformatted string, similar to printf.

◆ SFATAL

#define SFATAL (   message,
  ... 
)    logOutput(Saga::LogLevel::FATAL, message, ##__VA_ARGS__)

Log fatal-level messages.

Parameters
messageformatted string, similar to printf.

◆ SINFO

#define SINFO (   message,
  ... 
)    logOutput(Saga::LogLevel::INFO, message, ##__VA_ARGS__)

Log info-level messages.

Parameters
messageformatted string, similar to printf.

◆ STRACE

#define STRACE (   message,
  ... 
)    logOutput(Saga::LogLevel::TRACE, message, ##__VA_ARGS__)

Log trace-level messages.

Parameters
messageformatted string, similar to printf.

◆ SWARN

#define SWARN (   message,
  ... 
)    logOutput(Saga::LogLevel::WARN, message, ##__VA_ARGS__)

Log warn-level messages.

Parameters
messageformatted string, similar to printf.