CPN
Computational Process Networks
Public Member Functions | Private Attributes | List of all members
LoggerStdOutput Class Reference

A LoggerOutput implementation that prints to stdout. More...

#include <Logger.h>

+ Inheritance diagram for LoggerStdOutput:
+ Collaboration diagram for LoggerStdOutput:

Public Member Functions

 LoggerStdOutput (int level)
 
int LogLevel (int level)
 
int LogLevel () const
 
void Log (int level, const std::string &msg)
 Log a message to this outputer. More...
 

Private Attributes

Sync::ReentrantLock lock
 
int loglevel
 

Detailed Description

A LoggerOutput implementation that prints to stdout.

Definition at line 118 of file Logger.h.

Constructor & Destructor Documentation

LoggerStdOutput::LoggerStdOutput ( int  level)
inline

Definition at line 120 of file Logger.h.

120 : loglevel(level) {}

Member Function Documentation

void LoggerStdOutput::Log ( int  level,
const std::string &  msg 
)
virtual

Log a message to this outputer.

Parameters
levelthe level of this message
msgthe message

Implements LoggerOutput.

Definition at line 214 of file Logger.cc.

References lock, and loglevel.

214  {
216  if (level >= loglevel) {
217  std::cout << level << ":" << msg << std::endl;
218  }
219 }
Sync::ReentrantLock lock
Definition: Logger.h:125
int LoggerStdOutput::LogLevel ( int  level)
virtual
Parameters
levelthe new log level
Returns
the new log level

Implements LoggerOutput.

Definition at line 204 of file Logger.cc.

References lock, and loglevel.

204  {
206  return loglevel = level;
207 }
Sync::ReentrantLock lock
Definition: Logger.h:125
int LoggerStdOutput::LogLevel ( ) const
virtual
Returns
the current log level

Implements LoggerOutput.

Definition at line 209 of file Logger.cc.

References lock, and loglevel.

209  {
211  return loglevel;
212 }
Sync::ReentrantLock lock
Definition: Logger.h:125

Member Data Documentation

Sync::ReentrantLock LoggerStdOutput::lock
private

Definition at line 125 of file Logger.h.

Referenced by Log(), and LogLevel().

int LoggerStdOutput::loglevel
private

Definition at line 126 of file Logger.h.

Referenced by Log(), and LogLevel().


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