More elaborate documentation could be found in: http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/ programming_manual/diag.html
Definition in file ncbidiag.hpp.
#include <corelib/ncbistre.hpp>
#include <list>
#include <vector>
#include <map>
#include <memory>
#include <stdexcept>
#include <corelib/ncbidiag.inl>
Include dependency graph for ncbidiag.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| class | CDiagCompileInfo |
| Incapsulate compile time information such as _FILE_ _LINE NCBI_MODULE NCBI_MODULE is used only in .cpp file. More... | |
| struct | WRONG_ERROR_SUBCODE_IN_POST_MACRO< errorCode, errorSubcode, maxErrorSubcode, false > |
| Specialization of template: when error subcode is valid existence of this specialization will be valuable for not issuing compiler error. More... | |
| struct | WRONG_USAGE_OF_DEFINE_ERR_SUBCODE_MACRO< errorCode, false > |
| Specialization of template: when usage of NCBI_DEFINE_ERR_SUBCODE_X is correct existence of this specialization will be valuable for not issuing compiler error. More... | |
| class | ErrCode |
| ErrCode --. More... | |
| class | Severity |
| Severity --. More... | |
| class | MDiagModule |
| MDiagModule --. More... | |
| class | MDiagClass |
| MDiagClass --. More... | |
| class | MDiagFunction |
| MDiagFunction --. More... | |
| class | CNcbiDiag |
| CNcbiDiag --. More... | |
| class | CDiagCollectGuard |
| Guard for collecting diag messages (affects the current thread only). More... | |
| class | CDiagAutoPrefix |
| CDiagAutoPrefix --. More... | |
| class | INextDiagMessage |
| Callback interface for stream parser. More... | |
| struct | SDiagMessage |
| SDiagMessage --. More... | |
| class | CDiagContextThreadData |
| Thread local context data stored in TLS. More... | |
| class | CDiagContext_Extra |
| Temporary object for holding extra message arguments. More... | |
| class | CDiagContext |
| class | CDiagHandler |
| CDiagHandler --. More... | |
| class | CStreamDiagHandler_Base |
| CStreamDiagHandler_Base --. More... | |
| class | CStreamDiagHandler |
| CStreamDiagHandler --. More... | |
| class | CFileHandleDiagHandler |
| CFileHandleDiagHandler --. More... | |
| class | CFileDiagHandler |
| class | CDiagFactory |
| CDiagFactory --. More... | |
| class | CDiagRestorer |
| CDiagRestorer --. More... | |
| struct | SDiagErrCodeDescription |
| SDiagErrCodeDescription --. More... | |
| class | CDiagErrCodeInfo |
| CDiagErrCodeInfo --. More... | |
Defines | |
| #define | NCBI_CURRENT_FUNCTION NCBI_NS_NCBI::g_DiagUnknownFunction() |
| Get current function name. | |
| #define | NCBI_MAKE_MODULE(module) NCBI_AS_STRING(module) |
| Set default module name based on NCBI_MODULE macro. | |
| #define | DIAG_COMPILE_INFO |
| Make compile time diagnostic information object to use in CNcbiDiag and CException. | |
| #define | ERR_POST(message) |
| Error posting with file, line number information but without error codes. | |
| #define | LOG_POST(message) |
| Log message only without severity, location, prefix information. | |
| #define | ERR_POST_EX(err_code, err_subcode, message) |
| Error posting with error codes. | |
| #define | LOG_POST_EX(err_code, err_subcode, message) |
| Log posting with error codes. | |
| #define | NCBI_DEFINE_ERRCODE_X(name, err_code, max_err_subcode) |
| Define global error code name with given value (err_code) and given maximum value of error subcode within this code. | |
| #define | NCBI_DEFINE_ERR_SUBCODE_X(max_err_subcode) NCBI_DEFINE_ERR_SUBCODE_XX(NCBI_USE_ERRCODE_X, max_err_subcode) |
| Define maximum value of subcode for the error code currently in use. | |
| #define | NCBI_DEFINE_ERR_SUBCODE_XX(name, max_err_subcode) |
| Define maximum value of subcode for particular error code name. | |
| #define | NCBI_ERRCODE_X_NAME(name) NCBI_NS_NCBI::err_code_x::NCBI_NAME2(eErrCodeX_, name) |
| Returns value of error code by its name defined by NCBI_DEFINE_ERRCODE_X. | |
| #define | NCBI_ERRCODE_X NCBI_ERRCODE_X_NAME(NCBI_USE_ERRCODE_X) |
| Returns currently set default error code. | |
| #define | NCBI_MAX_ERR_SUBCODE_X_NAME(name) NCBI_NS_NCBI::err_code_x::NCBI_NAME2(SErrCodeX_Max_, name)<true>::value |
| Returns maximum value of error subcode within error code with given name. | |
| #define | NCBI_MAX_ERR_SUBCODE_X NCBI_MAX_ERR_SUBCODE_X_NAME(NCBI_USE_ERRCODE_X) |
| Returns maximum value of error subcode within current default error code. | |
| #define | NCBI_CHECK_ERRCODE_USAGE(name) |
| Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code. | |
| #define | NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode) |
| Issue compile-time error if error subcode given is not valid for given error code name. | |
| #define | NCBI_CHECK_ERR_SUBCODE_X(subcode) NCBI_CHECK_ERR_SUBCODE_X_NAME(NCBI_USE_ERRCODE_X, subcode) |
| Issue compile-time error if error subcode given is not valid for current error code. | |
| #define | ERR_POST_X(err_subcode, message) ERR_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
| Error posting with default error code and given error subcode. | |
| #define | LOG_POST_X(err_subcode, message) LOG_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
| Log posting with default error code and given error subcode. | |
| #define | ERR_POST_XX(error_name, err_subcode, message) |
| Error posting with error code having given name and with given error subcode. | |
| #define | LOG_POST_XX(error_name, err_subcode, message) |
| Log posting with error code having given name and with given error subcode. | |
| #define | NCBI_REPEAT_POST_N_TIMES(post_macro, count, params) |
| Common code for making log or error posting only given number of times during program execution. | |
| #define | LOG_POST_N_TIMES(count, message) NCBI_REPEAT_POST_N_TIMES( LOG_POST, count, (message) ) |
| Log posting only given number of times during program execution. | |
| #define | ERR_POST_N_TIMES(count, message) NCBI_REPEAT_POST_N_TIMES( ERR_POST, count, (message) ) |
| Error posting only given number of times during program execution. | |
| #define | LOG_POST_ONCE(message) LOG_POST_N_TIMES(1, message) |
| Log posting only once during program execution. | |
| #define | ERR_POST_ONCE(message) ERR_POST_N_TIMES(1, message) |
| Error posting only once during program execution. | |
| #define | LOG_POST_X_N_TIMES(count, err_subcode, message) NCBI_REPEAT_POST_N_TIMES( LOG_POST_X, count, (err_subcode, message) ) |
| Log posting only given number of times during program execution with default error code and given error subcode. | |
| #define | ERR_POST_X_N_TIMES(count, err_subcode, message) NCBI_REPEAT_POST_N_TIMES( ERR_POST_X, count, (err_subcode, message) ) |
| Error posting only given number of times during program execution with default error code and given error subcode. | |
| #define | LOG_POST_X_ONCE(err_subcode, message) LOG_POST_X_N_TIMES(1, err_subcode, message) |
| Log posting only once during program execution with default error code and given error subcode. | |
| #define | ERR_POST_X_ONCE(err_subcode, message) ERR_POST_X_N_TIMES(1, err_subcode, message) |
| Error posting only once during program execution with default error code and given error subcode. | |
| #define | LOG_POST_XX_N_TIMES(count, error_name, err_subcode, message) |
| Log posting only given number of times during program execution with given error code name and given error subcode. | |
| #define | ERR_POST_XX_N_TIMES(count, error_name, err_subcode, message) |
| Error posting only given number of times during program execution with given error code name and given error subcode. | |
| #define | LOG_POST_XX_ONCE(error_name, err_subcode, message) LOG_POST_XX_N_TIMES(1, error_name, err_subcode, message) |
| Log posting only once during program execution with given error code name and given error subcode. | |
| #define | ERR_POST_XX_ONCE(error_name, err_subcode, message) ERR_POST_XX_N_TIMES(1, error_name, err_subcode, message) |
| Error posting only once during program execution with given error code name and given error subcode. | |
| #define | NCBIDIAG_DEFER_GENERIC_PUT |
| #define | DIAG_POST_LEVEL "DIAG_POST_LEVEL" |
| Diagnostic post severity level. | |
| #define | DIAG_TRACE "DIAG_TRACE" |
| Diagnostic trace setting. | |
| #define | DIAG_MESSAGE_FILE "MessageFile" |
| Diagnostic message file. | |
Typedefs | |
| typedef int | TDiagPostFlags |
| Binary OR of "EDiagPostFlag". | |
| typedef void(* | FAbortHandler )(void) |
| Abort handler function type. | |
| typedef void(* | FDiagHandler )(const SDiagMessage &mess) |
| Diagnostic handler function type. | |
| typedef void(* | FDiagCleanup )(void *data) |
| Diagnostic cleanup function type. | |
Enumerations | |
| enum | EDiagSev { eDiag_Info = 0, eDiag_Warning, eDiag_Error, eDiag_Critical, eDiag_Fatal, eDiag_Trace, eDiagSevMin = eDiag_Info, eDiagSevMax = eDiag_Trace } |
| Severity level for the posted diagnostics. More... | |
| enum | EDiagSevChange { eDiagSC_Unknown, eDiagSC_Disable, eDiagSC_Enable } |
| Severity level change state. More... | |
| enum | EDiagPostFlag { eDPF_File = 0x1, eDPF_LongFilename = 0x2, eDPF_Line = 0x4, eDPF_Prefix = 0x8, eDPF_Severity = 0x10, eDPF_ErrorID = 0x20, eDPF_DateTime = 0x80, eDPF_ErrCodeMessage = 0x100, eDPF_ErrCodeExplanation = 0x200, eDPF_ErrCodeUseSeverity = 0x400, eDPF_Location = 0x800, eDPF_PID = 0x1000, eDPF_TID = 0x2000, eDPF_SerialNo = 0x4000, eDPF_SerialNo_Thread = 0x8000, eDPF_RequestId = 0x10000, eDPF_Iteration = 0x10000, eDPF_UID = 0x20000, eDPF_ErrCode = eDPF_ErrorID, eDPF_ErrSubCode = eDPF_ErrorID, eDPF_All = 0xFFFFF, eDPF_Trace = 0x581F, eDPF_Log = 0x0, eDPF_PreMergeLines = 0x100000, eDPF_MergeLines = 0x200000, eDPF_OmitInfoSev = 0x400000, eDPF_OmitSeparator = 0x800000, eDPF_AppLog = 0x1000000, eDPF_IsMessage = 0x2000000, eDPF_AtomicWrite = 0x4000000, eDPF_Default = 0x10000000, eDPF_ImportantFlagsMask, eDPF_UseExactUserFlags = 0x20000000 } |
| Which parts of the diagnostic context should be posted. More... | |
| enum | EDiagAppState { eDiagAppState_NotSet, eDiagAppState_AppBegin, eDiagAppState_AppRun, eDiagAppState_AppEnd, eDiagAppState_RequestBegin, eDiagAppState_Request, eDiagAppState_RequestEnd } |
| Application execution states shown in the std prefix. More... | |
| enum | EDiagTrace { eDT_Default = 0, eDT_Disable, eDT_Enable } |
| Which setting disables/enables posting of "eDiag_Trace" messages. More... | |
| enum | EAppDiagStream { eDS_ToStdout, eDS_ToStderr, eDS_ToStdlog, eDS_ToMemory, eDS_Disable, eDS_User, eDS_AppSpecific, eDS_Default, eDS_ToSyslog } |
| Where to write the application's diagnostics to. More... | |
| enum | EDiagCollectMessages { eDCM_Init, eDCM_InitNoLimit, eDCM_NoChange, eDCM_Flush, eDCM_Discard } |
| Flags to control collecting messages and flushing them to the new destination when switching diag handlers. More... | |
| enum | EPostNumberIncrement { ePostNumber_NoIncrement, ePostNumber_Increment } |
| Post nubmer increment flag for GetProcessPostNumber() and GetThreadPostNumber(). More... | |
| enum | EDiagFilter { eDiagFilter_Trace, eDiagFilter_Post, eDiagFilter_All } |
| Diag severity types to put the filter on. More... | |
| enum | EDiagFileType { eDiagFile_Err, eDiagFile_Log, eDiagFile_Trace, eDiagFile_All } |
| Type of file for the output. More... | |
Functions | |
| const char * | g_DiagUnknownFunction (void) |
| void | CheckErrSubcodeX (int) |
| Additional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro. | |
| bool | IsSetDiagPostFlag (EDiagPostFlag flag, TDiagPostFlags flags=eDPF_Default) |
| Check if a specified flag is set. | |
| TDiagPostFlags | SetDiagPostAllFlags (TDiagPostFlags flags) |
| Set global post flags to "flags". | |
| void | SetDiagPostFlag (EDiagPostFlag flag) |
| Set the specified flag (globally). | |
| void | UnsetDiagPostFlag (EDiagPostFlag flag) |
| Unset the specified flag (globally). | |
| TDiagPostFlags | SetDiagTraceAllFlags (TDiagPostFlags flags) |
| Versions of the above for extra trace flags. | |
| void | SetDiagTraceFlag (EDiagPostFlag flag) |
| void | UnsetDiagTraceFlag (EDiagPostFlag flag) |
| void | SetDiagPostPrefix (const char *prefix) |
| Specify a string to prefix all subsequent error postings with. | |
| void | PushDiagPostPrefix (const char *prefix) |
| Push a string to the list of message prefixes. | |
| void | PopDiagPostPrefix (void) |
| Pop a string from the list of message prefixes. | |
| int | GetDiagRequestId (void) |
| Get iteration number/request ID. | |
| void | SetDiagRequestId (int id) |
| Set iteration number/request ID. | |
| NCBI_DEPRECATED int | GetFastCGIIteration (void) |
| NCBI_DEPRECATED void | SetFastCGIIteration (int id) |
| EDiagSev | SetDiagPostLevel (EDiagSev post_sev=eDiag_Error) |
| Set the threshold severity for posting the messages. | |
| int | CompareDiagPostLevel (EDiagSev sev1, EDiagSev sev2) |
| Compare two severities. | |
| bool | IsVisibleDiagPostLevel (EDiagSev sev) |
| Check if the specified severity is higher or equal to the currently selected post level and will be printed by LOG_POST/ERR_POST. | |
| bool | DisableDiagPostLevelChange (bool disable_change=true) |
| Disable change the diagnostic post level. | |
| void | SetDiagFixedPostLevel (EDiagSev post_sev) |
| Sets and locks the level, combining the previous two calls. | |
| EDiagSev | SetDiagDieLevel (EDiagSev die_sev=eDiag_Fatal) |
| Set the "die" (abort) level for the program. | |
| bool | IgnoreDiagDieLevel (bool ignore) |
| Ignore the die level settings. | |
| void | SetAbortHandler (FAbortHandler func=0) |
| Set/unset abort handler. | |
| void | Abort (void) |
| Smart abort function. | |
| void | SetDiagTrace (EDiagTrace how, EDiagTrace dflt=eDT_Default) |
| Set the diagnostic trace settings. | |
| CNcbiOstream & | operator<< (CNcbiOstream &os, const SDiagMessage &mess) |
| Insert message in output stream. | |
| CDiagContext & | GetDiagContext (void) |
| Get diag context instance. | |
| void | SetDiagHandler (CDiagHandler *handler, bool can_delete=true) |
| Set the diagnostic handler using the specified diagnostic handler class. | |
| CDiagHandler * | GetDiagHandler (bool take_ownership=false) |
| Get the currently set diagnostic handler class. | |
| void | SetDiagHandler (FDiagHandler func, void *data, FDiagCleanup cleanup) |
| Set the diagnostic handler using the specified diagnostic handler and cleanup functions. | |
| bool | IsSetDiagHandler (void) |
| Check if diagnostic handler is set. | |
| void | DiagHandler_Reopen (void) |
| Ask diagnostic handler to reopen log files if necessary. | |
| void | SetDiagFilter (EDiagFilter what, const char *filter_str) |
| Set diagnostic filter. | |
| NCBI_DEPRECATED void | SetDoubleDiagHandler (void) |
| Output diagnostics using both old and new style handlers. | |
| void | SetDiagStream (CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="STREAM") |
| Set diagnostic stream. | |
| bool | IsDiagStream (const CNcbiOstream *os) |
| CNcbiOstream * | GetDiagStream (void) |
| Get current diagnostic stream (if it was set by SetDiagStream) or NULL. | |
| void | SetSplitLogFile (bool value=true) |
| Split log files flag. | |
| bool | GetSplitLogFile (void) |
| Get split log files flag. | |
| bool | SetLogFile (const string &file_name, EDiagFileType file_type=eDiagFile_All, bool quick_flush=true) |
| Set log files. | |
| string | GetLogFile (EDiagFileType file_type) |
| Get log file name for the given log type. | |
| string | GetLogFile (void) |
| Get log file name or diag handler name. | |
| void | SetDiagErrCodeInfo (CDiagErrCodeInfo *info, bool can_delete=true) |
| Set handler for processing error codes. | |
| bool | IsSetDiagErrCodeInfo () |
| Indicates whether an error-code processing handler has been set. | |
| CDiagErrCodeInfo * | GetDiagErrCodeInfo (bool take_ownership=false) |
| Get handler for processing error codes. | |
|
|
Definition at line 903 of file ncbidiag.hpp. |
1.4.6
Modified on Mon Dec 07 16:21:19 2009 by modify_doxy.py rev. 173732