Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
logger Namespace Reference

The logging namespace. More...

Classes

class  PostPrintEvent
 Post print event. More...
 

Functions

std::string getTime ()
 Get the Time as a string.
 
void loadConfig ()
 Loads the loglevel from the config.
 
void debug (const char *format,...)
 Logs something at the DEBUG level.
 
void info (const char *format,...)
 Logs something at the INFO level.
 
void plugin (const char *format,...)
 Logs something at the PLUGIN level, for plugins.
 
void warn (const char *format,...)
 Logs something at the WARN level.
 
void error (const char *format,...)
 Logs something at the ERROR level.
 
void fatal (const char *format,...)
 Logs something at the FATAL level.
 

Detailed Description

The logging namespace.

The logging namespace, contains all of the logging-related functions.

Function Documentation

◆ debug()

void logger::debug ( const char * format,
... )

Logs something at the DEBUG level.

In the end is just a wrapper around printf, so it will works like it. Should be used to log information only used by developers.

Parameters
formatthe format string to parse arguements in
...the arguments for the format

◆ error()

void logger::error ( const char * format,
... )

Logs something at the ERROR level.

In the end is just a wrapper around printf, so it will works like it. Should only be used to logs errors to the end user, when the program has done / detected something wrong, that impacts the end user.

Parameters
formatthe format string to parse arguements in
...the arguments for the format

◆ fatal()

void logger::fatal ( const char * format,
... )

Logs something at the FATAL level.

In the end is just a wrapper around printf, so it will works like it. Should only be used when a fatal error has happened, that crashes the program or has a severe impact for the well-being of the program.

Parameters
formatthe format string to parse arguements in
...the arguments for the format

◆ getTime()

std::string logger::getTime ( )

Get the Time as a string.

Gets the local time and returns a string representation of the time accompanied by the date and the month. Used for the console logging.

Returns
std::string the ascii representation of the local time as "day/month 24:60:60"

◆ info()

void logger::info ( const char * format,
... )

Logs something at the INFO level.

In the end is just a wrapper around printf, so it will works like it. Should be used to print out general information such as the current status of the program and so on and so on.

Parameters
formatthe format string to parse arguements in
...the arguments for the format

◆ loadConfig()

void logger::loadConfig ( )

Loads the loglevel from the config.

Loads the loglevel from the config and parse it to be usable, should only be used internally as a hook after the config was loaded, which is in Config::load().

◆ plugin()

void logger::plugin ( const char * format,
... )

Logs something at the PLUGIN level, for plugins.

In the end is just a wrapper around printf, so it will works like it. Should be used to print out general information such as the current status of the program and so on and so on.

Parameters
formatthe format string to parse arguments in
...the arguments for the format

◆ warn()

void logger::warn ( const char * format,
... )

Logs something at the WARN level.

In the end is just a wrapper around printf, so it will works like it. Should be used to log information that the end user should be warned about, but has no impact.

Parameters
formatthe format string to parse arguments in
...the arguments for the format