Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::Logger Class Reference

#include <tfLogger.h>

Static Public Member Functions

static void setLevel (int level=LOG_CURRENT)
 Set the Level objectsets the logging level to one a value from Logger::Level.
 
static int getLevel ()
 Get the Level objectget the current logging level.
 
static void disableLogging ()
 Suppresses all logging output.
 
static void disableConsoleLogging ()
 stops logging to the console, but file logging may continue.
 
static void enableConsoleLogging (int level=LOG_CURRENT)
 turns on console logging at the given level.
 
static void enableFileLogging (const std::string &fileName="", int level=LOG_CURRENT)
 turns on file logging to the given file as the given level.
 
static void disableFileLogging ()
 turns off file logging, but has no effect on console logging.
 
static std::string getCurrentLevelAsString ()
 get the textural form of the current logging level.
 
static std::string getFileName ()
 Get the File Name objectget the name of the currently used log file.
 
static std::string levelToString (int level)
 
static LogLevel stringToLevel (const std::string &str)
 
static void log (LogLevel level, const std::string &msg)
 logs a message to the log.
 
static void setConsoleStream (std::ostream *os)
 
static void setCallback (LoggerCallback)
 

Detailed Description

The Tissue Forge logger.

A set of static method for setting the logging level.

Member Function Documentation

◆ enableConsoleLogging()

static void TissueForge::Logger::enableConsoleLogging ( int level = LOG_CURRENT)
static

turns on console logging at the given level.

Parameters
levellogging level

◆ enableFileLogging()

static void TissueForge::Logger::enableFileLogging ( const std::string & fileName = "",
int level = LOG_CURRENT )
static

turns on file logging to the given file as the given level.

If fileName is an empty string, then nothing occurs.

Parameters
fileNamepath to log file
levellogging level

◆ getCurrentLevelAsString()

static std::string TissueForge::Logger::getCurrentLevelAsString ( )
static

get the textural form of the current logging level.

Returns
std::string

◆ getFileName()

static std::string TissueForge::Logger::getFileName ( )
static

Get the File Name objectget the name of the currently used log file.

Returns
std::string

◆ getLevel()

static int TissueForge::Logger::getLevel ( )
static

Get the Level objectget the current logging level.

Returns
int

◆ levelToString()

static std::string TissueForge::Logger::levelToString ( int level)
static

gets the textual form of a logging level Enum for a given value.

◆ log()

static void TissueForge::Logger::log ( LogLevel level,
const std::string & msg )
static

logs a message to the log.

Parameters
levellogging level
msglog message

◆ setConsoleStream()

static void TissueForge::Logger::setConsoleStream ( std::ostream * os)
static

Set a pointer to an ostream object where the console logger should log to.

Normally, this points to std::clog.

This is here so that the Logger can properly re-direct to the Python sys.stderr object as the QT IPython console only reads output from the python sys.stdout and sys.stderr file objects and not the C++ file streams.

◆ setLevel()

static void TissueForge::Logger::setLevel ( int level = LOG_CURRENT)
static

Set the Level objectsets the logging level to one a value from Logger::Level.

Parameters
levellogging level

◆ stringToLevel()

static LogLevel TissueForge::Logger::stringToLevel ( const std::string & str)
static

parses a string and returns a Logger::Level


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