KENSv3
KAIST Educational Network System
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
E::Log Class Reference

Log provides log-related utilities. We recommend you to inherit this class privately, and it will enable Log::print_log in your namespace. More...

#include <E_Log.hpp>

Inheritance diagram for E::Log:
E::System E::NetworkSystem

Public Types

enum  LOG_LEVEL {
  ERR , WARN , LOG , INFO ,
  DEBUG , LEVEL_COUNT
}
 Enumerations for log levels.
 

Public Member Functions

 Log ()
 Constructs a Log instance.
 
 Log (int level)
 Constructs a Log instance with log level. More...
 
 ~Log ()
 Destructs a Log instance.
 

Static Public Attributes

static int defaultLevel = Log::LOG_LEVEL
 Default log level.
 

Protected Member Functions

void print_log (int level, const char *format,...)
 Prints log with specified log level and format. Log::print_log prints all logs that has lower log level than the specified log level. For example, when log level is set to LOG, it prints ERR, WARN, and LOG logs. More...
 

Detailed Description

Log provides log-related utilities. We recommend you to inherit this class privately, and it will enable Log::print_log in your namespace.

Note
You cannot use both Log and NetworkLog simultaneously.
See also
E::NetworkLog

Constructor & Destructor Documentation

◆ Log()

E::Log::Log ( int  level)

Constructs a Log instance with log level.

Parameters
levelLog level

Member Function Documentation

◆ print_log()

void E::Log::print_log ( int  level,
const char *  format,
  ... 
)
protected

Prints log with specified log level and format. Log::print_log prints all logs that has lower log level than the specified log level. For example, when log level is set to LOG, it prints ERR, WARN, and LOG logs.

Note
NetworkLog::print_log
Parameters
levelLog level
formatFormat string
...Print arguments for format string

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