CARLsim
6.1.0
CARLsim: a GPU-accelerated SNN simulator
|
#include <Logger.h>
Public Types | |
enum | Level { DEBUG =0, DEVELOPER, USER, WARNING, ERROR } |
Public Member Functions | |
Logger (const Level level, std::ostream &logStream=std::cout) | |
Level | getLevel () |
virtual void | log (const Level level, const char *const message) |
A simple logging class. This will write messages to the given std::ostream as long as their level is higher than or equal to the configured loggerLevel. ERROR is the highest (always printed), DEBUG is the lowest.
Construct a Logger that outputs only messages higher than or equal to level, and writes the messages to the given ostream.
level | Messages below this level are ignored. |
logStream | The ostream to write messages to when they are received. The Logger holds a reference to the stream, but does not own it – the caller is responsible for closing file streams, etc, after they are done with the Logger. If no ostream is given, messages are written to std::cout by default. |
Definition at line 8 of file Logger.cpp.
Logger::Level getLevel | ( | ) |
View the logging level this Logger is configured at.
Definition at line 17 of file Logger.cpp.
|
virtual |
Write a message to the log at the given level.
level | Messages below this level will be ignored. |
message | c-string with the text to write to the log. |
Definition at line 11 of file Logger.cpp.