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

Public Member Functions

void initializeLogging (const std::string &identifier)
 
bool sendToLogger (int logLevel, std::string_view header, std::string_view message, bool disableRemote=false) const
 
void addLoggingCLI (std::shared_ptr< helicsCLI11App > &app)
 
void setLogLevel (int32_t level)
 
void setLogLevels (int32_t consoleLevel, int32_t fileLevel)
 
void logFlush ()
 
void setLoggerFunction (std::function< void(int level, std::string_view identifier, std::string_view message)> logFunction)
 
void setTransmitCallback (std::function< void(ActionMessage &&mm)> transmit)
 
int getMaxLevel () const
 
int getFileLevel () const
 
int getConsoleLevel () const
 
void setLoggingFile (std::string_view lfile, const std::string &identifier)
 
LogBuffergetLogBuffer ()
 
void updateRemote (GlobalFederateId destination, int level)
 

Public Attributes

std::atomic< bool > forceLoggingFlush {false}
 force the log to flush after every message
 

Member Function Documentation

◆ addLoggingCLI()

void helics::LogManager::addLoggingCLI ( std::shared_ptr< helicsCLI11App > &  app)

add logging Command line options to a CLI App

References forceLoggingFlush, and setLogLevel().

◆ logFlush()

void helics::LogManager::logFlush ( )

flush the loggers

◆ sendToLogger()

bool helics::LogManager::sendToLogger ( int  logLevel,
std::string_view  header,
std::string_view  message,
bool  disableRemote = false 
) const

send a message to the logging system

Returns
true if the message was actually logged

References helics::ActionMessage::dest_id, helics::FED, forceLoggingFlush, HELICS_LOG_LEVEL_DUMPLOG, and helics::ActionMessage::payload.

◆ setLoggerFunction()

void helics::LogManager::setLoggerFunction ( std::function< void(int level, std::string_view identifier, std::string_view message)>  logFunction)

set the logging callback function

Parameters
logFunctiona function with a signature of void(int level, std::string_view identifier, std::string_view message) the function takes a level indicating the logging level string with the source name and a string with the message

◆ setLogLevel()

void helics::LogManager::setLogLevel ( int32_t  level)

set the logging level

References setLogLevels().

Referenced by addLoggingCLI().

◆ setLogLevels()

void helics::LogManager::setLogLevels ( int32_t  consoleLevel,
int32_t  fileLevel 
)

set the logging levels

Parameters
consoleLevelthe logging level for the console display
fileLevelthe logging level for the log file

Referenced by setLogLevel().


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