NuTo
Numerics Tool
Public Member Functions | Protected Attributes | List of all members
NuTo::Logger Class Reference

logger class for redirecting output to different locations/files More...

#include <Logger.h>

Public Member Functions

 Logger (std::string prefix="", bool isQuiet=true)
 ...constructor More...
 
void OpenFile (std::string filename)
 ..open file More...
 
void CloseFile ()
 ..Close file More...
 
void SetQuiet (bool isQuiet)
 ..sets the output to be forwarded to the console (false) or only to the file (true) More...
 
template<typename T >
void Out (const T &rObject, bool withNewline=false)
 ..Writes a message to the log and to console More...
 
std::string OptionalPrefix ()
 
void Info () const
 Info routine that prints general information about the object (detail according to verbose level) More...
 

Protected Attributes

std::ofstream mLogFile
 Logfile for output. More...
 
std::string mLogFileName
 LogfileName for output. More...
 
bool mIsQuiet = false
 If true, no writing to console. More...
 
std::string mPrefix
 prefix written on the beginning of the log line More...
 
bool mPrintPrefix = true
 

Detailed Description

logger class for redirecting output to different locations/files

Author
Jörg F. Unger, NU
Date
July 2011

Constructor & Destructor Documentation

NuTo::Logger::Logger ( std::string  prefix = "",
bool  isQuiet = true 
)

...constructor

Member Function Documentation

void NuTo::Logger::CloseFile ( )

..Close file

void NuTo::Logger::Info ( ) const
inline

Info routine that prints general information about the object (detail according to verbose level)

void NuTo::Logger::OpenFile ( std::string  filename)

..open file

Parameters
filenamefile string to open
std::string NuTo::Logger::OptionalPrefix ( )
template<typename T >
void NuTo::Logger::Out ( const T &  rObject,
bool  withNewline = false 
)
inline

..Writes a message to the log and to console

void NuTo::Logger::SetQuiet ( bool  isQuiet)

..sets the output to be forwarded to the console (false) or only to the file (true)

Parameters
isQuietsee explanation above

Member Data Documentation

bool NuTo::Logger::mIsQuiet = false
protected

If true, no writing to console.

;

std::ofstream NuTo::Logger::mLogFile
protected

Logfile for output.

std::string NuTo::Logger::mLogFileName
protected

LogfileName for output.

std::string NuTo::Logger::mPrefix
protected

prefix written on the beginning of the log line

bool NuTo::Logger::mPrintPrefix = true
protected

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