Project stdui: "Simple Type Dialog User-Interface"

|
Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

debug::cdebug Class Reference

This is a starting of the logger class with few utility for now. It will become thread-safe and more generic ...later... More...

#include <cdebug.hxx>

List of all members.


Public Member Functions

 cdebug ()
 cdebug (int ichan, const char *filename, const char *func, int line)
template<typename t>
std::ofstream & operator<< (t &_arg)
void end ()
 ~cdebug ()
string getfilename ()

Static Public Member Functions

static bool init (const string &app_name="debug")
static const std::string & appname ()
static void disable (int c=-1)
static void enable ()

Private Attributes

unsigned int _ch

Static Private Attributes

static dbch::dictionary _channels
static std::ofstream Os
static bool started
static std::string _appname
static int indentation
static bool __enabled
static std::string function
static int line
static string filename

Detailed Description

This is a starting of the logger class with few utility for now. It will become thread-safe and more generic ...later...

Definition at line 57 of file cdebug.hxx.


Constructor & Destructor Documentation

debug::cdebug::cdebug  ) 
 

debug::cdebug::cdebug int  ichan,
const char *  filename,
const char *  func,
int  line
 

debug::cdebug::~cdebug  ) 
 


Member Function Documentation

static const std::string& debug::cdebug::appname  )  [inline, static]
 

Definition at line 72 of file cdebug.hxx.

References _appname.

00072                                     {
00073      return _appname;
00074    }

static void debug::cdebug::disable int  c = -1  )  [inline, static]
 

Definition at line 86 of file cdebug.hxx.

00086 {        cdebug::__enabled = false;    }

debug::cdebug::enable  )  [inline, static]
 

Definition at line 91 of file cdebug.hxx.

00091 {      cdebug::__enabled = true;      }

void debug::cdebug::end  )  [inline]
 

Definition at line 77 of file cdebug.hxx.

00077             {
00078     cdebug::os.flush();
00079     cdebug::os.close();
00080   }

string debug::cdebug::getfilename  ) 
 

static bool debug::cdebug::init const string &  app_name = "debug"  )  [static]
 

template<typename T>
ofstream & debug::cdebug::operator<< t &  _arg  ) 
 

Definition at line 102 of file cdebug.hxx.

References _ch.

00102                                                           {
00103 
00104     dbch::iterator it = cdebug::_channels.find(_ch);
00105     if(it  == cdebug::_channels.end() ) return cdebug::Os;
00106     if( !(*it)._active || !cdebug::__enabled ) return cdebug::Os;
00107     string f = getFilename() + ':';
00108     string i((*it)._indent*4, ' ');
00109     cdebug::Os << (*it).id <<':' << f << cdebug::function << ':' << cdebug::line << ':' << i << _arg;
00110     return cdebug::Os;
00111 }


Member Data Documentation

bool debug::cdebug::__enabled [static, private]
 

Definition at line 64 of file cdebug.hxx.

std::string debug::cdebug::_appname [static, private]
 

Definition at line 62 of file cdebug.hxx.

Referenced by appname().

unsigned int debug::cdebug::_ch [private]
 

Definition at line 97 of file cdebug.hxx.

Referenced by operator<<().

dbch::dictionary debug::cdebug::_channels [static, private]
 

Definition at line 59 of file cdebug.hxx.

string debug::cdebug::filename [static, private]
 

Definition at line 96 of file cdebug.hxx.

std::string debug::cdebug::function [static, private]
 

Definition at line 65 of file cdebug.hxx.

int debug::cdebug::indentation [static, private]
 

Definition at line 63 of file cdebug.hxx.

int debug::cdebug::line [static, private]
 

Definition at line 66 of file cdebug.hxx.

std::ofstream debug::cdebug::Os [static, private]
 

Definition at line 60 of file cdebug.hxx.

bool debug::cdebug::started [static, private]
 

Definition at line 61 of file cdebug.hxx.


The documentation for this class was generated from the following file:
API Documentation Generated by:  doxygen 1.4.0
About the author | Site started with trial version of DreamWeaver MX 2004 | Finalizing with  | Contact | ©2005, Serge Lussier ( Bretzel )