NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CDiagCollectGuard Class Reference

Search Toolkit Book for CDiagCollectGuard

Guard for collecting diag messages (affects the current thread only). More...

#include <corelib/ncbidiag.hpp>

Public Types

enum  EAction { ePrint , eDiscard , ePrintCapped }
 Action to perform in guard's destructor. More...
 

Public Member Functions

 CDiagCollectGuard (void)
 Set collectable severity and optionally applied print-severity cap to the current post level, Print severity is set to critical. More...
 
 CDiagCollectGuard (EDiagSev print_severity)
 Set collectable severity and optionally applied print-severity cap to the current post level, Print severity is set to the specified value but can be ignored if it's lower than the currently set post level (or print severity set by a higher level guard). More...
 
 CDiagCollectGuard (EDiagSev print_severity, EDiagSev collect_severity, EAction action=eDiscard)
 Create diag collect guard with the given severities and action. More...
 
 ~CDiagCollectGuard (void)
 Destroy the guard, return post level to the one set before the guard initialization. More...
 
EDiagSev GetPrintSeverity (void) const
 Get current print severity. More...
 
void SetPrintSeverity (EDiagSev sev)
 Set new print severity. More...
 
EDiagSev GetCollectSeverity (void) const
 Get current collect severity. More...
 
void SetCollectSeverity (EDiagSev sev)
 Set new collect severity. More...
 
EDiagSev GetSeverityCap (void) const
 Get current severity cap for use in ePrintCapped mode. More...
 
void SetSeverityCap (EDiagSev sev)
 Set new severity cap for use in PrintCapped mode. More...
 
EAction GetAction (void) const
 Get selected on-destroy action. More...
 
void SetAction (EAction action)
 Specify on-destroy action. More...
 
Uint8 GetStartingPoint (void) const
 Get the lowest thread-local post number in this guard's scope. More...
 
void Release (void)
 Release the guard. More...
 
void Release (EAction action)
 Release the guard. More...
 

Private Member Functions

void x_Init (EDiagSev print_severity, EDiagSev collect_severity, EAction action)
 

Private Attributes

Uint8 m_StartingPoint
 
EDiagSev m_PrintSev
 
EDiagSev m_CollectSev
 
EDiagSev m_SeverityCap
 
EAction m_Action
 

Detailed Description

Guard for collecting diag messages (affects the current thread only).

Messages with the severity equal or above 'print' severity will be printed but not collected. Messages having severity below 'print' severity and equal or above 'collect' severity will be collected, and later can be either discarded or printed out upon the guard destruction or when Release() is called.

Note
Nested guards are allowed. Each guard takes care to restore the severity thresholds set by the previous one.

Definition at line 1299 of file ncbidiag.hpp.


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:57 2024 by modify_doxy.py rev. 669887