#include "gdef.h"
#include <sstream>
#include <string>
Go to the source code of this file.
|
namespace | G |
| Low-level classes.
|
|
|
#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 ) |
|
◆ G_DEBUG
◆ G_DEBUG_IF
#define G_DEBUG_IF |
( |
|
cond, |
|
|
|
expr |
|
) |
| |
◆ G_DEBUG_ONCE
#define G_DEBUG_ONCE |
( |
|
group, |
|
|
|
expr |
|
) |
| |
◆ G_ERROR
#define G_ERROR |
( |
|
expr | ) |
G_LOG_IMP( expr , G::Log::Severity::s_Error ) |
◆ G_LOG
#define G_LOG |
( |
|
expr | ) |
G_LOG_IMP( expr , G::Log::Severity::s_InfoVerbose ) |
◆ G_LOG_IF
#define G_LOG_IF |
( |
|
cond, |
|
|
|
expr |
|
) |
| G_LOG_IMP_IF( cond , expr , G::Log::Severity::s_InfoVerbose ) |
◆ 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) |
◆ 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) |
◆ G_LOG_ONCE
#define G_LOG_ONCE |
( |
|
expr | ) |
G_LOG_IMP_ONCE( expr , G::Log::Severity::s_InfoVerbose ) |
◆ G_LOG_S
#define G_LOG_S |
( |
|
expr | ) |
G_LOG_IMP( expr , G::Log::Severity::s_InfoSummary ) |
◆ G_LOG_S_IF
#define G_LOG_S_IF |
( |
|
cond, |
|
|
|
expr |
|
) |
| G_LOG_IMP_IF( cond , expr , G::Log::Severity::s_InfoSummary ) |
◆ G_LOG_S_ONCE
#define G_LOG_S_ONCE |
( |
|
expr | ) |
G_LOG_IMP_ONCE( expr , G::Log::Severity::s_InfoSummary ) |
◆ G_WARNING
#define G_WARNING |
( |
|
expr | ) |
G_LOG_IMP( expr , G::Log::Severity::s_Warning ) |
◆ G_WARNING_ONCE
#define G_WARNING_ONCE |
( |
|
expr | ) |
G_LOG_IMP_ONCE( expr , G::Log::Severity::s_Warning ) |