n3rv::logger

class n3rv::logger

n3rv logging class Allows to produce timestamped log inside files (so far, syslog udp/512 also planned).

Public Functions

void n3rv::loggeradd_dest(const char *dest)

Adds a destination for the log stream.

Parameters
  • dest: destination of the logs, eg “file:///var/log/n3rv.log”, “stdout”, or “syslog:name:facility” Note: available syslog facilities are “local0” to “local7”, and “user”

std::istream &n3rv::loggeroperator>>(std::istream &is)

Note: If buffer encounters std::endl then if is flushed to destinations.

void n3rv::loggerlog(int log_level, std::string str)

Adds str to log buffer and flushes it.

Parameters
  • log_level: log level of the string to log.
  • str: string to log.

void n3rv::loggerset_loglevel(int lvl)

Changes current logger’s log level.

Parameters
  • lvl: log level to set, from 0 to 4.

n3rv::loggerlogger(int log_level)

class constructor

n3rv::logger~logger()

class destructor