S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

S3 Logging System

This documents the S3 Logging System, its components and usage. The S3 Logger is used to log text messages to any of a number of devices. It is heavily based on C++ iostreams (actually only ostreams) and thus works just like cout (i.e. you can use all the << operators and modifiers).

The following components exist:

All of the above components (with the exception of s3_msgb_log_rx_thread, which is a thread) is derived from class std::ostream and could be used as follows:
   
      // Construct an instance of the file logger.
      s3_filelogger s3_log( "my_logfile.txt" );
      
      // Log messages to the file.
      s3_log << "This is demo message number " << 1 << endl;
      s3_log << "This is demo message number " << 2 << endl;
      s3_log << "We can also log other types like floats: " 
             << float( 1.234 ) << endl;
   

The end of a message is indicated by streaming std::endl or std::flush to the ostream.

Class s3_logger is special in the sence that it can log simultaneously to a number of ostreams. Also, it prepends a specified string (ident) and a message severity string to all logs. An instance of this class (s3_log) is contructed automatically at runtime for your convenience.

Author:
Francois Swanepoel <swanepoel@stonethree.com>

Send comments to: s3fc@stonethree.com SourceForge Logo