helics  3.5.2
Public Member Functions | Public Attributes | List of all members
helics::LoggerNoThread Class Reference

#include <logger.h>

Public Member Functions

 LoggerNoThread ()
 
 LoggerNoThread (const std::shared_ptr< LoggingCore > &core)
 
void openFile (const std::string &file)
 
void closeFile ()
 
void startLogging (int cLevel, int fLevel)
 
void startLogging ()
 
void log (int level, const std::string &logMessage)
 
void log (const std::string &logMessage)
 
bool isRunning () const
 
void flush ()
 
void changeLevels (int cLevel, int fLevel)
 

Public Attributes

int consoleLevel = log_everything
 level below which we need to print to the console
 
int fileLevel = log_everything
 level below which we need to print to a file
 

Detailed Description

logging class that handle the logs immediately with no threading or synchronization

Constructor & Destructor Documentation

◆ LoggerNoThread() [1/2]

helics::LoggerNoThread::LoggerNoThread ( )
default

default constructor

◆ LoggerNoThread() [2/2]

helics::LoggerNoThread::LoggerNoThread ( const std::shared_ptr< LoggingCore > &  core)
explicit

this does nothing with the argument since it is not threaded here to match the API of Logger

Member Function Documentation

◆ changeLevels()

void helics::LoggerNoThread::changeLevels ( int  cLevel,
int  fLevel 
)

alter the printing levels

Parameters
cLevelthe level to print to the console
fLevelthe level to print to the file if it is open

References consoleLevel, and fileLevel.

◆ closeFile()

void helics::LoggerNoThread::closeFile ( )

close the file for logging

◆ flush()

void helics::LoggerNoThread::flush ( )

flush the log queue

◆ isRunning()

bool helics::LoggerNoThread::isRunning ( ) const

check if the logging thread is running

◆ log() [1/2]

void helics::LoggerNoThread::log ( const std::string &  logMessage)
inline

message to log without regard for levels*

Parameters
logMessagethe message to log

References helics::always_log, and log().

Referenced by log().

◆ log() [2/2]

void helics::LoggerNoThread::log ( int  level,
const std::string &  logMessage 
)

log a message at a particular level

Parameters
levelthe level of the message
logMessagethe actual message to log

References consoleLevel, and fileLevel.

◆ openFile()

void helics::LoggerNoThread::openFile ( const std::string &  file)

open a file to write the log messages

Parameters
filethe name of the file to write messages to

◆ startLogging() [1/2]

void helics::LoggerNoThread::startLogging ( )
inline

overload of /ref startLogging with unspecified logging levels

References consoleLevel, fileLevel, and startLogging().

Referenced by startLogging().

◆ startLogging() [2/2]

void helics::LoggerNoThread::startLogging ( int  cLevel,
int  fLevel 
)

function to start the logging thread

Parameters
cLevelthe console print level
fLevelthe file print level messages coming in below these levels will be printed

References consoleLevel, and fileLevel.


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