E-MailRelay
Classes | Namespaces | Macros
glog.h File Reference
#include "gdef.h"
#include <sstream>
#include <string>

Go to the source code of this file.

Classes

class  G::Log
 A class for doing iostream-based logging. More...
 

Namespaces

namespace  G
 Low-level classes.
 

Macros

#define G_LOG_IMP(expr, severity)   do { try { if(G::Log::at(severity)) G::Log((severity),__FILE__,__LINE__) << expr ; } catch(...) {} } while(0)
 The DEBUG macro is for debugging during development, the LOG macro generates informational logging in verbose mode only, the 'summary' LOG_S macro generates informational logging even when not verbose, and the WARNING and ERROR macros are used for error warning/error messages although in programs where logging can be disabled completely (see G::LogOutput) error conditions should be made visible by some other means (such as stderr). More...
 
#define G_LOG_IMP_IF(cond, expr, severity)   do { try { if(G::Log::at(severity)&&(cond)) G::Log((severity),__FILE__,__LINE__) << expr ; } catch(...) {} } while(0)
 
#define G_LOG_IMP_ONCE(expr, severity)   do { static bool done__ = false ; try { if(!done__) G::Log((severity),__FILE__,__LINE__) << expr ; } catch(...) {} done__ = true ; } while(0)
 
#define G_DEBUG(expr)
 
#define G_DEBUG_IF(cond, expr)
 
#define G_DEBUG_ONCE(group, expr)
 
#define G_LOG(expr)   G_LOG_IMP( expr , G::Log::Severity::s_InfoVerbose )
 
#define G_LOG_IF(cond, expr)   G_LOG_IMP_IF( cond , expr , G::Log::Severity::s_InfoVerbose )
 
#define G_LOG_ONCE(expr)   G_LOG_IMP_ONCE( expr , G::Log::Severity::s_InfoVerbose )
 
#define G_LOG_S(expr)   G_LOG_IMP( expr , G::Log::Severity::s_InfoSummary )
 
#define G_LOG_S_IF(cond, expr)   G_LOG_IMP_IF( cond , expr , G::Log::Severity::s_InfoSummary )
 
#define G_LOG_S_ONCE(expr)   G_LOG_IMP_ONCE( expr , G::Log::Severity::s_InfoSummary )
 
#define G_WARNING(expr)   G_LOG_IMP( expr , G::Log::Severity::s_Warning )
 
#define G_WARNING_ONCE(expr)   G_LOG_IMP_ONCE( expr , G::Log::Severity::s_Warning )
 
#define G_ERROR(expr)   G_LOG_IMP( expr , G::Log::Severity::s_Error )
 

Macro Definition Documentation

◆ G_DEBUG

#define G_DEBUG (   expr)

Definition at line 106 of file glog.h.

◆ G_DEBUG_IF

#define G_DEBUG_IF (   cond,
  expr 
)

Definition at line 107 of file glog.h.

◆ G_DEBUG_ONCE

#define G_DEBUG_ONCE (   group,
  expr 
)

Definition at line 108 of file glog.h.

◆ G_ERROR

#define G_ERROR (   expr)    G_LOG_IMP( expr , G::Log::Severity::s_Error )

Definition at line 140 of file glog.h.

◆ G_LOG

#define G_LOG (   expr)    G_LOG_IMP( expr , G::Log::Severity::s_InfoVerbose )

Definition at line 112 of file glog.h.

◆ G_LOG_IF

#define G_LOG_IF (   cond,
  expr 
)    G_LOG_IMP_IF( cond , expr , G::Log::Severity::s_InfoVerbose )

Definition at line 113 of file glog.h.

◆ G_LOG_IMP

#define G_LOG_IMP (   expr,
  severity 
)    do { try { if(G::Log::at(severity)) G::Log((severity),__FILE__,__LINE__) << expr ; } catch(...) {} } while(0)

The DEBUG macro is for debugging during development, the LOG macro generates informational logging in verbose mode only, the 'summary' LOG_S macro generates informational logging even when not verbose, and the WARNING and ERROR macros are used for error warning/error messages although in programs where logging can be disabled completely (see G::LogOutput) error conditions should be made visible by some other means (such as stderr).

Definition at line 97 of file glog.h.

◆ G_LOG_IMP_IF

#define G_LOG_IMP_IF (   cond,
  expr,
  severity 
)    do { try { if(G::Log::at(severity)&&(cond)) G::Log((severity),__FILE__,__LINE__) << expr ; } catch(...) {} } while(0)

Definition at line 98 of file glog.h.

◆ G_LOG_IMP_ONCE

#define G_LOG_IMP_ONCE (   expr,
  severity 
)    do { static bool done__ = false ; try { if(!done__) G::Log((severity),__FILE__,__LINE__) << expr ; } catch(...) {} done__ = true ; } while(0)

Definition at line 99 of file glog.h.

◆ G_LOG_ONCE

#define G_LOG_ONCE (   expr)    G_LOG_IMP_ONCE( expr , G::Log::Severity::s_InfoVerbose )

Definition at line 114 of file glog.h.

◆ G_LOG_S

#define G_LOG_S (   expr)    G_LOG_IMP( expr , G::Log::Severity::s_InfoSummary )

Definition at line 122 of file glog.h.

◆ G_LOG_S_IF

#define G_LOG_S_IF (   cond,
  expr 
)    G_LOG_IMP_IF( cond , expr , G::Log::Severity::s_InfoSummary )

Definition at line 123 of file glog.h.

◆ G_LOG_S_ONCE

#define G_LOG_S_ONCE (   expr)    G_LOG_IMP_ONCE( expr , G::Log::Severity::s_InfoSummary )

Definition at line 124 of file glog.h.

◆ G_WARNING

#define G_WARNING (   expr)    G_LOG_IMP( expr , G::Log::Severity::s_Warning )

Definition at line 132 of file glog.h.

◆ G_WARNING_ONCE

#define G_WARNING_ONCE (   expr)    G_LOG_IMP_ONCE( expr , G::Log::Severity::s_Warning )

Definition at line 133 of file glog.h.