remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGLog Class Reference

A class for managing log messages. More...

#include <RMGLog.hh>

Public Types

enum  LogLevel {
  debug_event = 0 , debug = 10 , detail = 20 , summary = 30 ,
  warning = 40 , error = 50 , fatal = 60 , nothing = 70
}
 
enum  Ansi {
  black = 30 , red = 31 , green = 32 , yellow = 33 ,
  blue = 34 , magenta = 35 , cyan = 36 , grey = 37 ,
  unspecified
}
 

Public Member Functions

Constructor and destructor
 RMGLog ()
 

Static Public Member Functions

Getters
static RMGLog::LogLevel GetLogLevel ()
 
static bool GetPrefix ()
 
Setters
static void SetLogLevel (RMGLog::LogLevel loglevel)
 
static void SetPrefix (bool flag)
 
static void SetProcNum (int proc_num)
 
static void SetInihibitStartupInfo (bool flag)
 
Miscellaneous
template<typename T>
static void Out (RMGLog::LogLevel loglevel, const T &message)
 
template<typename T, typename... Args>
static void Out (RMGLog::LogLevel loglevel, const T &msg_first, const Args &... args)
 
template<typename... Args>
static void OutFormat (RMGLog::LogLevel loglevel, const std::string &fmt, const Args &... args)
 
template<typename T, typename... Args>
static void Out (RMGLog::LogLevel loglevel, T &msg_first, Args... msg_other)
 
static void StartupInfo ()
 
static const std::string & GetVersion ()
 
static bool SupportsColors (const std::ostream &os)
 
template<RMGLog::Ansi color, typename T>
static std::string Colorize (const T &msg, std::ostream &os, bool bold=false)
 
static bool HadWarning ()
 
static bool HadError ()
 

Detailed Description

A class for managing log messages.

Author
Daniel Kollar
Kevin Kröninger
Version
1.0
Date
08.2008

This class manages log messages for printing on the screen

Member Enumeration Documentation

◆ LogLevel

Enumerator for the amount of details to put into the log

Enumerator
debug_event 

Print everything, including debug info (also in the event loop)

debug 

Print everything, including debug info (not in the event loop)

detail 

Print all details of operation.

summary 

Print only results summary, warnings, and errors.

warning 

Print only warnings and errors.

error 

Print only errors.

fatal 

Print only errors, stop execution.

nothing 

Print nothing.

Constructor & Destructor Documentation

◆ RMGLog()

RMGLog::RMGLog ( )

Constructor.

Member Function Documentation

◆ GetLogLevel()

static RMGLog::LogLevel RMGLog::GetLogLevel ( )
inlinestatic

Returns the minimum log level for screen output.

Returns
log level

◆ GetPrefix()

static bool RMGLog::GetPrefix ( )
inlinestatic

Returns true if the loglevel is prefixed to every message. Default: true

◆ GetVersion()

static const std::string & RMGLog::GetVersion ( )
inlinestatic
Returns
string containing the version number

◆ Out()

template<typename T>
static void RMGLog::Out ( RMGLog::LogLevel loglevel,
const T & message )
static

Writes string to the screen log if the log level is equal or greater than the minimum

Parameters
loglevelloglevel for the current message
messagestring to write to the screen log

◆ SetInihibitStartupInfo()

static void RMGLog::SetInihibitStartupInfo ( bool flag)
inlinestatic

Toggle if a startup message is shown before the first log message.

◆ SetLogLevel()

static void RMGLog::SetLogLevel ( RMGLog::LogLevel loglevel)
inlinestatic

Sets the minimum log level for screen output.

Parameters
loglevellog level

◆ SetPrefix()

static void RMGLog::SetPrefix ( bool flag)
inlinestatic

Toggle if the loglevel is prefixed to every message.

◆ SetProcNum()

static void RMGLog::SetProcNum ( int proc_num)
inlinestatic

Set the process number.

◆ StartupInfo()

void RMGLog::StartupInfo ( )
static

Writes startup information onto screen


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