Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Public Member Functions | List of all members
cypress::Logger Class Reference

#include <logger.hpp>

Public Member Functions

 Logger ()
 
 Logger (std::shared_ptr< LogBackend > backend, LogSeverity lvl=LogSeverity::INFO)
 
size_t backend_count () const
 
int add_backend (std::shared_ptr< LogBackend > backend, LogSeverity lvl=LogSeverity::INFO)
 
void min_level (LogSeverity lvl, int idx=-1)
 
LogSeverity min_level (int idx=-1)
 
size_t count (LogSeverity lvl=LogSeverity::DEBUG) const
 
void log (LogSeverity lvl, std::time_t time, const std::string &module, const std::string &message)
 
void debug (const std::string &module, const std::string &message)
 
void info (const std::string &module, const std::string &message)
 
void warn (const std::string &module, const std::string &message)
 
void error (const std::string &module, const std::string &message)
 
void fatal_error (const std::string &module, const std::string &message)
 

Detailed Description

The Logger class is the frontend class that should be used to log messages. A global instance which logs to std::cerr can be accessed using the global_logger() function.

Constructor & Destructor Documentation

cypress::Logger::Logger ( )

Default constructor, adds no backend.

cypress::Logger::Logger ( std::shared_ptr< LogBackend backend,
LogSeverity  lvl = LogSeverity::INFO 
)

Creates a new Logger instance which logs into the given backend.

Member Function Documentation

int cypress::Logger::add_backend ( std::shared_ptr< LogBackend backend,
LogSeverity  lvl = LogSeverity::INFO 
)

Adds another logger backend with the given log level and returns the index of the newly added backend.

size_t cypress::Logger::backend_count ( ) const

Returns the number of attached backends.

size_t cypress::Logger::count ( LogSeverity  lvl = LogSeverity::DEBUG) const

Returns the number of messages that have been captured with at least the given level.

void cypress::Logger::debug ( const std::string &  module,
const std::string &  message 
)
void cypress::Logger::error ( const std::string &  module,
const std::string &  message 
)
void cypress::Logger::fatal_error ( const std::string &  module,
const std::string &  message 
)
void cypress::Logger::info ( const std::string &  module,
const std::string &  message 
)
void cypress::Logger::log ( LogSeverity  lvl,
std::time_t  time,
const std::string &  module,
const std::string &  message 
)
void cypress::Logger::min_level ( LogSeverity  lvl,
int  idx = -1 
)

Sets the minimum level for the backend with the given index. Negative indices allow to access the backend list in reverse order. Per default the log level of the last added backend is updated.

LogSeverity cypress::Logger::min_level ( int  idx = -1)

Returns the log level for the backend with the given index. Negative indices allow to access the backend list in reverse order.

void cypress::Logger::warn ( const std::string &  module,
const std::string &  message 
)

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