chrono::ChLogConsole Class Reference

Description

Specialized class for logging errors in std::cout.

Messages, warnings, etc. go always into the standard console.

#include <ChLog.h>

Inheritance diagram for chrono::ChLogConsole:
Collaboration diagram for chrono::ChLogConsole:

Public Member Functions

 ChLogConsole ()
 Create default logger: this will use the std::cout.
 
virtual void Output (const char *data, size_t n)
 Redirect output stream to file wrapper.
 
- Public Member Functions inherited from chrono::ChLog
virtual void Flush ()
 Forces output of message buffers, if any. More...
 
void SetDefaultLevel (eChLogLevel mlev)
 Sets the default level, to be used from now on.
 
void SetCurrentLevel (eChLogLevel mlev)
 Sets the current level, to be used until new flushing.
 
eChLogLevel GetCurrentLevel ()
 Gets the current level.
 
void RestoreDefaultLevel ()
 Restore the default level.
 
ChLogoperator- (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" ;.
 
- Public Member Functions inherited from chrono::ChStreamOutAscii
ChStreamOutAsciioperator<< (bool bVal)
 Generic << operator for all classes which implement serialization by means of a method named 'void StreamOut(ChStreamOutAscii&)'.
 
ChStreamOutAsciioperator<< (char tch)
 
ChStreamOutAsciioperator<< (const int nVal)
 
ChStreamOutAsciioperator<< (const double dVal)
 
ChStreamOutAsciioperator<< (const float fVal)
 
ChStreamOutAsciioperator<< (unsigned int unVal)
 
ChStreamOutAsciioperator<< (char *str)
 
ChStreamOutAsciioperator<< (const char *str)
 
ChStreamOutAsciioperator<< (const std::string &str)
 
ChStreamOutAsciioperator<< (unsigned long unVal)
 
ChStreamOutAsciioperator<< (unsigned long long unVal)
 
template<class T >
ChStreamOutAsciioperator< (T obj)
 OBSOLETE use ChArchive << operator and ArchiveOut()
 
virtual void Format (char *formatString,...)
 Output the log message in form of a formatted string, like in printf().
 
void SetNumFormat (const char *mf)
 Set the formatting string (ex "%f" or "%g" etc.) for float->text conversion.
 
char * GetNumFormat ()
 
void SetCommentTrailer (char *mt)
 Set the trailer symbol before each comment (example: "#" , or "//").
 
void CR ()
 Outputs carriage return.
 
void TAB ()
 Output tab.
 
void Comment (char m_string[])
 Output comment with preceding trailer (e.g., #).
 
void Bar ()
 Output a separation bar in ASCII file.
 
- Public Member Functions inherited from chrono::ChStreamOstreamWrapper
 ChStreamOstreamWrapper (std::ostream *mfile)
 Creates a wrapper for an already existing, already opened, ostream, given the pointer to that ostream.
 
virtual ~ChStreamOstreamWrapper ()
 Deleting this stream wrapper does not delete nor closes the wrapped ostream.
 
virtual void Write (const char *data, size_t n)
 Writes raw data to file, up to n chars. More...
 
virtual bool End_of_stream () const
 Returns true if end of stream reached.
 
std::ostream * GetOstream () const
 Reference to ostream encapsulated here.
 

Additional Inherited Members

- Public Types inherited from chrono::ChLog
enum  eChLogLevel {
  CHERROR = 0, CHWARNING, CHMESSAGE, CHSTATUS,
  CHQUIET
}
 There are different levels of log messages. More...
 
- Public Types inherited from chrono::ChStream
enum  eChMode { CHFILE_NORMAL = 0, CHFILE_NOWRITE, CHFILE_SAFEWRITE, CHFILE_OPENLATER }
 [Obsolete] Modes for chrono files (the ch-modes). More...
 
enum  eChStreamError { CHSTREAM_OK = 0, CHSTREAM_EOF, CHSTREAM_FAIL }
 Errors for chrono files (the ch-modes). More...
 
- Protected Member Functions inherited from chrono::ChLog
 ChLog ()
 Creates the ChLog, and sets the level at MESSAGE.
 
- Protected Attributes inherited from chrono::ChLog
eChLogLevel current_level
 
eChLogLevel default_level
 
- Protected Attributes inherited from chrono::ChStreamOutAscii
char number_format [10]
 
char comment_trailer [10]
 

The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono/core/ChLog.h