C++ Extensions (cppx) Documentation Internal Version
Main | Namespaces | Classes | NamespaceMembers | ClassMembers | Files

stdx::Log Class Reference

This log object allows a user to set a log level for all inserted objects, and then set a log level for the entire log. If the local log level is above the global log level then the output is not inserted, otherwise it is. This allows for choosing how much log information to output at runtime.

 stdx::Log outputLog( std::cout, 2 );
 outputLog.log(1) << "Log level is at or below 1!" << stdx::endl;
 outputLog.log(2) << "Log level is at or below 2!" << stdx::endl;
 outputLog.log(3) << "Log level is at or below 3!" << stdx::endl;

This code will output the following:

 Log level is at or below 1!
 Log level is at or below 2!
 

List of all members.

Public Methods

Constructors and Destructors
Accessor Functions
Mutator Functions

Detailed Documentation

Constructor & Destructor Documentation

stdx::Log::Log std::ostream &    os,
int    runtimeLogLevel = 0
 

Member Function Documentation

int stdx::Log::getRuntimeLogLevel  
 

Return the runtime log level

bool stdx::Log::isEnabled  
 

Return whether or not this log is enabled

void stdx::Log::setRuntimeLogLevel int    logLevel
 

Set the runtime log level

void stdx::Log::setEnabled bool    enabled
 

Allows a user to enable or disable a log

std::ostream& stdx::Log::log int    logLevel = 0
 

This function is how a user can insert objects to the log. Simply call this function with the desired log level and insert objects into the returned output stream normally.



The documentation for this class was generated from the following file:
Generated on Mon Aug 15 21:43:10 2005 by Doxygen 1.2.13-20020210 written by Dimitri van Heesch © 1997-2002