Classes | Public Types | Public Member Functions | Friends | List of all members
G::Log Class Reference

A static 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. More...
 
 ~Log ()
 Destructor. Writes the accumulated string to the log output. More...
 
std::ostream & operator<< (const char *s)
 Streams 's' and then returns a stream for streaming more stuff into. More...
 
std::ostream & operator<< (const std::string &s)
 Streams 's' and then returns a stream for streaming more stuff into. More...
 

Friends

class G::Log::Line
 

Detailed Description

A static 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 50 of file glog.h.

Member Enumeration Documentation

Enumerator
s_LogVerbose 
s_LogSummary 
s_Debug 
s_Warning 
s_Error 
s_Assertion 

Definition at line 53 of file glog.h.

Constructor & Destructor Documentation

G::Log::Log ( Severity  severity,
const char *  file,
int  line 
)

Constructor.

Definition at line 25 of file glog.cpp.

G::Log::~Log ( )

Destructor. Writes the accumulated string to the log output.

Definition at line 32 of file glog.cpp.

Member Function Documentation

std::ostream & G::Log::operator<< ( const char *  s)

Streams 's' and then returns a stream for streaming more stuff into.

Definition at line 68 of file glog.cpp.

std::ostream & G::Log::operator<< ( const std::string &  s)

Streams 's' and then returns a stream for streaming more stuff into.

Definition at line 74 of file glog.cpp.

Friends And Related Function Documentation

friend class G::Log::Line
friend

Definition at line 76 of file glog.h.


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