MULTIBODY SIMULATION SOFTWARE - API documentation

chrono::ChLog Class Reference

#include <CHlog.h>

Inheritance diagram for chrono::ChLog:

Inheritance graph
[legend]
Collaboration diagram for chrono::ChLog:

Collaboration graph
[legend]

List of all members.

Public Types

enum  eChLogLevel {
  CHERROR = 0, CHWARNING, CHMESSAGE, CHSTATUS,
  CHQUIET
}

Public Member Functions

 ChLog ()
virtual void Flush ()
void SetDefaultLevel (eChLogLevel mlev)
void SetCurrentLevel (eChLogLevel mlev)
eChLogLevel GetCurrentLevel ()
void RestoreDefaultLevel ()
ChLogoperator- (eChLogLevel mnewlev)

Protected Attributes

eChLogLevel current_level
eChLogLevel default_level


Detailed Description

Base class for output of errors, messages, warnings, etc. (logging class). Must be specialized for specific output, for example output to console, to windows, etc. by inheriting custom classes. See below, an example for logging to std::cout

Member Enumeration Documentation

enum chrono::ChLog::eChLogLevel

There are different levels of log messages. This is indifferent for the base class, but more sophisticated specializations of the ChLog class may handle message output in different ways (for example a ChLogForGUIapplication may print logs in STATUS level only to the bottom of the window, etc.)


Constructor & Destructor Documentation

chrono::ChLog::ChLog (  ) 

Creates the ChLog, and sets the level at MESSAGE.


Member Function Documentation

virtual void chrono::ChLog::Flush (  )  [virtual]

Forces output of message buffers, if any. Also, should restore the default eChLogLevel This base class does pretty nothing, but inherited classes should override this method with more specific implementations.

void chrono::ChLog::SetDefaultLevel ( eChLogLevel  mlev  ) 

Sets the default level, to be used from now on.

void chrono::ChLog::SetCurrentLevel ( eChLogLevel  mlev  ) 

Sets the current level, to be used until new flushing.

eChLogLevel chrono::ChLog::GetCurrentLevel (  ) 

Gets the current level.

void chrono::ChLog::RestoreDefaultLevel (  ) 

Restore the default level.

ChLog & chrono::ChLog::operator- ( eChLogLevel  mnewlev  ) 

Using the - operator is easy to set the status of the log, so in you code you can write, for example: GetLog() - ChLog::CHERROR << "a big error in " << mynumber << " items \n" ;


CHRONO::ENGINE
C++ library for multibody simulation, (C) Alessandro Tasora
This API documentation has been generated on 17 Jul 2009 by Doxygen