CARLsim  6.1.0
CARLsim: a GPU-accelerated SNN simulator
Logger Class Reference

#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)
 

Detailed Description

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.

Definition at line 10 of file Logger.h.

Member Enumeration Documentation

◆ Level

enum Level
Enumerator
DEBUG 
DEVELOPER 
USER 
WARNING 
ERROR 

Definition at line 12 of file Logger.h.

Constructor & Destructor Documentation

◆ Logger()

Logger ( const Level  level,
std::ostream &  logStream = std::cout 
)

Construct a Logger that outputs only messages higher than or equal to level, and writes the messages to the given ostream.

Parameters
levelMessages below this level are ignored.
logStreamThe 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.

Member Function Documentation

◆ getLevel()

Logger::Level getLevel ( )

View the logging level this Logger is configured at.

Definition at line 17 of file Logger.cpp.

◆ log()

void log ( const Level  level,
const char *const  message 
)
virtual

Write a message to the log at the given level.

Parameters
levelMessages below this level will be ignored.
messagec-string with the text to write to the log.

Definition at line 11 of file Logger.cpp.


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