Castle Battle  1.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
Logger Class Reference

This singleton class handles logs and debugging. More...

#include <Logger.h>

Public Member Functions

void print (LOG_TYPE type, int level, core::stringc str)
 Print message. More...
 

Static Public Member Functions

static LoggergetLogger ()
 Return the instance. More...
 

Private Member Functions

void initLogger ()
 Init singleton logger. More...
 
 Logger ()
 Default constructor. More...
 

Static Private Attributes

static Loggerlogger = NULL
 Self instance. More...
 

Detailed Description

This singleton class handles logs and debugging.

In particular the DEBUG_OUTPUT_MASK directive define the verbosity of the messages. DEBUG_OUTPUT_MASK 1 mean enable all couts that have level = 1 on their calls DEBUG_OUTPUT_MASK 2 mean enable all couts that have level = 2 on their calls DEBUG_OUTPUT_MASK 3 mean enable all tracing and debugging For now there are 2 level. The level 2 will also activate a visual debugging(you can move around the map)

Constructor & Destructor Documentation

◆ Logger()

Logger::Logger ( )
private

Default constructor.

Not used

14  {
15 
16 }

Member Function Documentation

◆ getLogger()

Logger * Logger::getLogger ( )
static

Return the instance.

6  {
7  if(logger == NULL)
8  logger = new Logger();
9  return logger;
10 }
static Logger * logger
Self instance.
Definition: Logger.h:74
Logger()
Default constructor.
Definition: Logger.cpp:14

◆ initLogger()

void Logger::initLogger ( )
private

Init singleton logger.

◆ print()

void Logger::print ( LOG_TYPE  type,
int  level,
core::stringc  str 
)

Print message.

Parameters
typeLOG_TYPE
levelint
strstringc string to print
See also
: Logger
11  {
12  cout<<str.c_str()<<endl;
13 }

Member Data Documentation

◆ logger

Logger * Logger::logger = NULL
staticprivate

Self instance.


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