VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::Log Class Reference

A class for doing iostream-based logging. More...

#include <glog.h>

Classes

class  Line
 A class for adding line number information to the Log output. More...
 

Public Types

enum  Severity {
  s_LogVerbose, s_LogSummary, s_Debug, s_Warning,
  s_Error, s_Assertion
}
 

Public Member Functions

 Log (Severity, const char *file, int line)
 Constructor.
 
 ~Log ()
 Destructor. Writes the accumulated string to the log output.
 
std::ostream & operator<< (const char *s)
 Streams 's' and then returns a stream for streaming more stuff into.
 
std::ostream & operator<< (const std::string &s)
 Streams 's' and then returns a stream for streaming more stuff into.
 

Static Public Member Functions

static bool at (Severity)
 Returns true if G::LogOutput::output() would log at the given level. More...
 

Friends

class G::Log::Line
 

Detailed Description

A class for doing iostream-based logging.

The G_LOG/G_DEBUG/G_WARNING/G_ERROR macros are provided as a convenient way of using this interface.

Usage:

G::Log(G::Log::s_LogSummary,__FILE__,__LINE__) << a << b ;

or

G_LOG( a << b ) ;
See Also
G::LogOutput

Definition at line 48 of file glog.h.

Member Function Documentation

bool G::Log::at ( Severity  s)
static

Returns true if G::LogOutput::output() would log at the given level.

This can be used as an optimisation to short-ciruit the stream-out expression evaluation.

Definition at line 43 of file glog.cpp.


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