Project Malmo  0.30.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
malmo::Logger Class Reference

Public Types

enum  LoggingSeverityLevel {
  LOG_OFF, LOG_ERRORS, LOG_WARNINGS, LOG_INFO,
  LOG_FINE, LOG_TRACE, LOG_ALL
}
 Specifies the detail that will be logged, if logging is enabled.
 

Public Member Functions

 Logger (const malmo::Logger &)=delete
 
template<LoggingSeverityLevel level, typename... Args>
void print (Args &&...args)
 
void setSeverityLevel (LoggingSeverityLevel level)
 
void setFilename (const std::string &file)
 

Static Public Member Functions

static LoggergetLogger ()
 
static void setLogging (const std::string &filename, LoggingSeverityLevel severity_level)
 Sets logging options for debugging. More...
 
static void appendToLog (LoggingSeverityLevel severity_level, const std::string &message)
 Add a single line to the log. More...
 

Protected Member Functions

void indent ()
 
void unindent ()
 
void clear_backlog ()
 
void performWrite (const std::string &logline)
 

Static Protected Member Functions

static void log_spooler (Logger *logger)
 

Friends

template<LoggingSeverityLevel level>
class LogSection
 
class LoggerLifetimeTracker
 
void log_spooler (Logger *logger)
 

Member Function Documentation

static void malmo::Logger::appendToLog ( LoggingSeverityLevel  severity_level,
const std::string &  message 
)
inlinestatic

Add a single line to the log.

Provided for external use - swigged/bound to allow user code to add to the log, to assist in debugging. Internal (Malmo) code should use the macros instead.

Parameters
severity_levelThe level for this log line. The message to add to the log file.
static void malmo::Logger::setLogging ( const std::string &  filename,
LoggingSeverityLevel  severity_level 
)
inlinestatic

Sets logging options for debugging.

Parameters
filenameA filename to output log messages to. Will use the console if this is empty / can't be written to.
severity_levelDetermine how verbose the log will be.

The documentation for this class was generated from the following file: