NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Enumerator | Functions | Variables | Friends
Run-Time Diagnostics
+ Collaboration diagram for Run-Time Diagnostics:

Classes

class  CJaegerTracerSpan
 
class  CJaegerTracer
 IRequestTracer implementation for Jaeger tracing. More...
 
class  CDiagCompileInfo
 Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function. More...
 
struct  WRONG_ERROR_SUBCODE_IN_POST_MACRO< errorCode, errorSubcode, maxErrorSubcode, isWrong >
 Template structure used to point out wrong error subcode in ERR_POST_X, STD_CATCH_X and alike macros. 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, isWrong >
 Template structure used to point out incorrect usage of NCBI_DEFINE_ERR_SUBCODE_X macro i.e. 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  SetPostFlags
 SetPostFlags –. 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  CStrictId< TKey, TStorage >
 Template class for strict ID types. More...
 
class  CDiagContext_Extra
 Temporary object for holding extra message arguments. More...
 
class  CDiagContext
 
class  CNcbiLogFields
 CNcbiLogFields –. More...
 
class  CDiagHandler
 
class  CStreamDiagHandler_Base
 CStreamDiagHandler_Base –. More...
 
class  CStreamDiagHandler
 CStreamDiagHandler –. More...
 
class  CFileHandleDiagHandler
 CFileHandleDiagHandler –. More...
 
class  CFileDiagHandler
 CFileDiagHandler –. More...
 
class  CAsyncDiagHandler
 
class  CDiagFactory
 CDiagFactory –. More...
 
class  CDiagRestorer
 CDiagRestorer –. More...
 
struct  SDiagErrCodeDescription
 SDiagErrCodeDescription –. More...
 
class  CDiagErrCodeInfo
 CDiagErrCodeInfo –. More...
 
class  CPerfLogger
 CPerfLogger –. More...
 
class  CPerfLogGuard
 CPerfLogGuard –. More...
 
class  CSharedHitId
 Helper class to hold hit id and sub-hit counter which can be shared between multiple request contexts. More...
 
class  IRequestTracer
 
class  ITracerSpan
 
class  CRequestContext
 
class  CRequestContext_PassThrough
 Request context properties passed between tasks. More...
 
class  CRequestContextGuard_Base
 Take guard of the current CRequestContext, handle app-state, start/stop logging and request status in the dtor. More...
 
class  CRequestContextException
 
class  CRequestStatus
 
class  CSysLog
 
struct  SNcbiLog_Param
 Structure to describe pairs 'key=value', used to posting parameters. More...
 

Macros

#define NCBI_CURRENT_FUNCTION   NCBI_NS_NCBI::g_DiagUnknownFunction()
 Get current function name. More...
 
#define NCBI_MAKE_MODULE(module)   NCBI_AS_STRING(module)
 Set default module name based on NCBI_MODULE macro. More...
 
#define DIAG_COMPILE_INFO
 Make compile time diagnostic information object to use in CNcbiDiag and CException. More...
 
#define ERR_POST(message)
 Error posting with file, line number information but without error codes. More...
 
#define SEVERITY_POST(severity, message)
 Wrappers for ERR_POST family of macros checking if the desired severity is enabled. More...
 
#define WARNING_POST(message)   SEVERITY_POST(Warning, message)
 
#define INFO_POST(message)   SEVERITY_POST(Info, message)
 
#define TRACE_POST(message)   SEVERITY_POST(Trace, message)
 
#define SEVERITY_POST_X(severity, subcode, message)
 
#define WARNING_POST_X(subcode, message)   SEVERITY_POST_X(Warning, subcode, message)
 
#define INFO_POST_X(subcode, message)   SEVERITY_POST_X(Info, subcode, message)
 
#define TRACE_POST_X(subcode, message)   SEVERITY_POST_X(Trace, subcode, message)
 
#define SEVERITY_POST_EX(severity, errcode, subcode, message)
 
#define WARNING_POST_EX(errcode, subcode, message)   SEVERITY_POST_EX(Warning, errcode, subcode, message)
 
#define INFO_POST_EX(errcode, message)   SEVERITY_POST_EX(Info, errcode, subcode, message)
 
#define TRACE_POST_EX(errcode, message)   SEVERITY_POST_EX(Trace, errcode, subcode, message)
 
#define LOG_POST(message)
 This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro LOG_POST_X to make possible more flexible error statistics and logging. More...
 
#define ERR_FATAL(message)
 Posting fatal error and abort. More...
 
#define ERR_POST_EX(err_code, err_subcode, message)
 Error posting with error codes. More...
 
#define LOG_POST_EX(err_code, err_subcode, message)
 
#define ERR_FATAL_EX(err_code, err_subcode, message)
 
#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. More...
 
#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. More...
 
#define NCBI_DEFINE_ERR_SUBCODE_XX(name, max_err_subcode)
 Define maximum value of subcode for particular error code name. More...
 
#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. More...
 
#define NCBI_ERRCODE_X   NCBI_ERRCODE_X_NAME(NCBI_USE_ERRCODE_X)
 Returns currently set default error code. More...
 
#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. More...
 
#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. More...
 
#define NCBI_CHECK_ERRCODE_USAGE(name)
 Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code. More...
 
#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. More...
 
#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. More...
 
#define NCBI_ERR_SUBCODE_X_NAME(name, subcode)    (NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode), subcode)
 Pass subcode as argument with check of its validity for given error code. More...
 
#define NCBI_ERR_SUBCODE_X(subcode)    (NCBI_CHECK_ERR_SUBCODE_X(subcode), subcode)
 Pass subcode as argument with check of its validity for current error code. More...
 
#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. More...
 
#define LOG_POST_X(err_subcode, message)    LOG_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message)
 
#define ERR_FATAL_X(err_subcode, message)    ERR_FATAL_XX(NCBI_USE_ERRCODE_X, err_subcode, message)
 
#define ERR_POST_XX(error_name, err_subcode, message)
 Error posting with error code having given name and with given error subcode. More...
 
#define LOG_POST_XX(error_name, err_subcode, message)
 
#define ERR_FATAL_XX(error_name, err_subcode, message)
 
#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. More...
 
#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. More...
 
#define LOG_POST_N_TIMES(count, message)    NCBI_REPEAT_POST_N_TIMES( LOG_POST, count, (message) )
 
#define ERR_POST_ONCE(message)   ERR_POST_N_TIMES(1, message)
 Error posting only once during program execution. More...
 
#define LOG_POST_ONCE(message)   LOG_POST_N_TIMES(1, message)
 
#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. More...
 
#define LOG_POST_X_N_TIMES(count, err_subcode, message)    NCBI_REPEAT_POST_N_TIMES( LOG_POST_X, count, (err_subcode, message) )
 
#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. More...
 
#define LOG_POST_X_ONCE(err_subcode, message)    LOG_POST_X_N_TIMES(1, err_subcode, message)
 
#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. More...
 
#define LOG_POST_XX_N_TIMES(count, error_name, err_subcode, message)
 
#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. More...
 
#define LOG_POST_XX_ONCE(error_name, err_subcode, message)    LOG_POST_XX_N_TIMES(1, error_name, err_subcode, message)
 
#define DIAG_POST_LEVEL   "DIAG_POST_LEVEL"
 Diagnostic post severity level. More...
 
#define DIAG_TRACE   "DIAG_TRACE"
 Diagnostic trace setting. More...
 
#define DIAG_MESSAGE_FILE   "MessageFile"
 Diagnostic message file. More...
 
#define PERF_POST(perf_logger, status, resource, args)
 Convenience macro that also saves cycles when the performance logging is globally turned off. More...
 
#define PERF_POST_DB(perf_logger, status, resource, server, args)
 Adaptation for logging database performance. More...
 
#define __STDC_FORMAT_MACROS
 
#define NCBILOG_INT8_FORMAT_SPEC   "I64"
 
#define NCBILOG_UINT8_FORMAT_SPEC   "I64u"
 

Typedefs

typedef int TDiagUserAndHost
 
typedef int TDiagPostFlags
 Binary OR of "EDiagPostFlag". More...
 
typedef const CNcbiDiag &(* CNcbiDiag::FManip) (const CNcbiDiag &)
 Diagnostic stream manipulator. More...
 
typedef IOS_BASE &(* CNcbiDiag::FIosbaseManip) (IOS_BASE &)
 
typedef CNcbiIos &(* CNcbiDiag::FIosManip) (CNcbiIos &)
 
typedef void(* FAbortHandler) (void)
 Abort handler function type. More...
 
typedef Uint8 SDiagMessage::TPID
 Process ID. More...
 
typedef Uint8 SDiagMessage::TTID
 Thread ID. More...
 
typedef Int8 SDiagMessage::TUID
 Unique process ID. More...
 
typedef Uint8 SDiagMessage::TCount
 Generic type for counters (posts, requests etc.) More...
 
typedef pair< string, stringSDiagMessage::TExtraArg
 
typedef list< TExtraArgSDiagMessage::TExtraArgs
 
typedef int SDiagMessage::TDiagWriteFlags
 
typedef SDiagMessage::TExtraArg CDiagContext_Extra::TExtraArg
 
typedef SDiagMessage::TExtraArgs CDiagContext_Extra::TExtraArgs
 
typedef Uint8 CDiagContext::TPID
 
typedef int CDiagContext::TOnForkFlags
 
typedef SDiagMessage::TUID CDiagContext::TUID
 
typedef SDiagMessage::TCount CDiagContext::TCount
 
typedef Uint8 CDiagContext::TTID
 Get thread ID used in messages. More...
 
typedef map< string, stringCDiagContext::TProperties
 
typedef list< SDiagMessageCDiagContext::TMessages
 
typedef list< stringCNcbiLogFields::TFields
 
typedef int CDiagHandler::TReopenFlags
 
typedef void(* FDiagHandler) (const SDiagMessage &mess)
 Diagnostic handler function type. More...
 
typedef void(* FDiagCleanup) (void *data)
 Diagnostic cleanup function type. More...
 
typedef CStreamDiagHandler_Base CFileHandleDiagHandler::TParent
 
typedef deque< SDiagMessageCFileHandleDiagHandler::TMessages
 Save messages if the handle is unavailable. More...
 
typedef CStreamDiagHandler_Base CFileDiagHandler::TParent
 
typedef map< ErrCode, SDiagErrCodeDescriptionCDiagErrCodeInfo::TInfo
 Define map for error messages. More...
 
typedef unsigned int CSharedHitId::TSubHitId
 
typedef CObjectFor< CAtomicCounterCSharedHitId::TSharedCounter
 
typedef int CRequestContext::TContextFlags
 
typedef SDiagMessage::TCount CRequestContext::TCount
 
typedef map< string, stringCRequestContext::TProperties
 User-defined request properties. More...
 
typedef CAtomicCounter::TValue CRequestContext::TVersion
 
typedef int CRequestContext::TPropSet
 
typedef map< string, string, PNocaseCRequestContext::TPassThroughProperties
 
typedef CRequestContext::TPassThroughProperties CRequestContext_PassThrough::TProperties
 
typedef int CRequestContextGuard_Base::TFlags
 
typedef int CSysLog::TFlags
 
typedef CSysLog CSysLogDiagHandler
 
typedef struct TNcbiLog_MTLock_tagTNcbiLog_MTLock
 
typedef int(* FNcbiLog_MTLock_Handler) (void *user_data, ENcbiLog_MTLock_Action action)
 MT locking callback. More...
 
typedef __int64 TNcbiLog_Int8
 Big integer type. More...
 
typedef unsigned __int64 TNcbiLog_UInt8
 
typedef TNcbiLog_UInt8 TNcbiLog_PID
 Process, thread and counter types. More...
 
typedef TNcbiLog_UInt8 TNcbiLog_TID
 
typedef TNcbiLog_UInt8 TNcbiLog_Counter
 
typedef struct SNcbiLog_Context_tagTNcbiLog_Context
 
typedef int TNcbiLog_OnForkFlags
 Binary OR of "ENcbiLog_OnForkAction". More...
 

Enumerations

enum  EDiagUserAndHost { fDiag_AddUser = 1 << 0 , fDiag_AddHost = 1 << 1 , fDiag_OverrideExisting = 1 << 2 }
 Flags for SetDiagUserAndHost() More...
 
enum  { WRONG_ERROR_SUBCODE_IN_POST_MACRO< errorCode, errorSubcode, maxErrorSubcode, false >::valid = 1 }
 
enum  { WRONG_USAGE_OF_DEFINE_ERR_SUBCODE_MACRO< errorCode, false >::valid = 1 }
 
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 = 1 << 0 , eDPF_LongFilename = 1 << 1 , eDPF_Line = 1 << 2 , eDPF_Prefix = 1 << 3 ,
  eDPF_Severity = 1 << 4 , eDPF_ErrorID = 1 << 5 , eDPF_DateTime = 1 << 7 , eDPF_ErrCodeMessage = 1 << 8 ,
  eDPF_ErrCodeExplanation = 1 << 9 , eDPF_ErrCodeUseSeverity = 1 << 10 , eDPF_Location = 1 << 11 , eDPF_TID = 1 << 13 ,
  eDPF_PID = 0 , eDPF_SerialNo = 0 , eDPF_SerialNo_Thread = 0 , eDPF_RequestId = 0 ,
  eDPF_Iteration = eDPF_RequestId , eDPF_UID = 0 , eDPF_ErrCode = eDPF_ErrorID , eDPF_ErrSubCode = eDPF_ErrorID ,
  eDPF_All = 0x7FFFF , eDPF_Trace , eDPF_Exception = eDPF_Trace | eDPF_ErrorID , eDPF_Log = 0 ,
  eDPF_ErrCodeMsgInFront = 1 << 19 , eDPF_MergeLines = 1 << 21 , eDPF_PreMergeLines = eDPF_MergeLines , eDPF_OmitInfoSev = 1 << 22 ,
  eDPF_OmitSeparator = 1 << 23 , eDPF_AppLog = 1 << 24 , eDPF_IsNote = 1 << 25 , eDPF_IsMessage = eDPF_IsNote ,
  eDPF_AtomicWrite = 1 << 26 , eDPF_IsConsole = 1 << 27 , eDPF_Default = 1 << 28 , eDPF_ImportantFlagsMask ,
  eDPF_UseExactUserFlags = 1 << 29
}
 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  CDiagCollectGuard::EAction { CDiagCollectGuard::ePrint , CDiagCollectGuard::eDiscard , CDiagCollectGuard::ePrintCapped }
 Action to perform in guard's destructor. More...
 
enum  EDiagTrace { eDT_Default = 0 , eDT_Disable , eDT_Enable }
 Which setting disables/enables posting of "eDiag_Trace" messages. More...
 
enum  SDiagMessage::EEventType {
  SDiagMessage::eEvent_Start , SDiagMessage::eEvent_Stop , SDiagMessage::eEvent_Extra , SDiagMessage::eEvent_RequestStart ,
  SDiagMessage::eEvent_RequestStop , SDiagMessage::eEvent_PerfLog
}
 Type of event to report. More...
 
enum  SDiagMessage::EDiagWriteFlags { SDiagMessage::fNone = 0x0 , SDiagMessage::fNoEndl = 0x01 , SDiagMessage::fNoPrefix = 0x02 }
 Compose a message string in the standard format(see also "flags"): "<file>", line <line>: <severity>: [<prefix>] <message> [EOL] and put it to string "str", or write to an output stream "os". More...
 
enum  SDiagMessage::EFormatFlag { SDiagMessage::eFormat_Old , SDiagMessage::eFormat_New , SDiagMessage::eFormat_Auto }
 
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 number increment flag for GetProcessPostNumber() and GetThreadPostNumber(). More...
 
enum  CDiagContext::FOnForkAction { CDiagContext::fOnFork_PrintStart = 1 << 0 , CDiagContext::fOnFork_ResetTimer = 1 << 1 , CDiagContext::fOnFork_AsyncSafe = 1 << 15 }
 Actions to perform in UpdateOnFork(). More...
 
enum  CDiagContext::EPropertyMode { CDiagContext::eProp_Default , CDiagContext::eProp_Global , CDiagContext::eProp_Thread }
 Property visibility flag. More...
 
enum  CDiagContext::ELogRate_Type { CDiagContext::eLogRate_App , CDiagContext::eLogRate_Err , CDiagContext::eLogRate_Trace }
 Type of logging rate limit. More...
 
enum  CDiagContext::EDefaultHitIDFlags { CDiagContext::eHitID_NoCreate , CDiagContext::eHitID_Create }
 
enum  EDiagFileType {
  eDiagFile_Err , eDiagFile_Log , eDiagFile_Trace , eDiagFile_Perf ,
  eDiagFile_All
}
 CDiagHandler –. More...
 
enum  CDiagHandler::EReopenFlags { CDiagHandler::fTruncate = 0x01 , CDiagHandler::fCheck = 0x02 , CDiagHandler::fDefault = 0 }
 
enum  EDiagFilter { eDiagFilter_Trace , eDiagFilter_Post , eDiagFilter_All }
 Diag severity types to put the filter on. More...
 
enum  CPerfLogger::EStart { CPerfLogger::eStart , CPerfLogger::eSuspend }
 If to start the timing immediately. More...
 
enum  CRequestContext::EContextFlags { CRequestContext::fResetOnStart = 1 , CRequestContext::fDefault = 0 }
 Request context flags. More...
 
enum  CRequestContext::EHitIDSource { CRequestContext::eHitID_Any = 0 , CRequestContext::eHitID_Request = 0x01 , CRequestContext::eHitID_Default = 0x02 , CRequestContext::eHidID_Existing = eHitID_Default | eHitID_Request }
 Hit ID Allowed source of the current hit id. More...
 
enum  CRequestContext::ESessionIDFormat { CRequestContext::eSID_Ncbi , CRequestContext::eSID_Standard , CRequestContext::eSID_Other }
 Session ID format. More...
 
enum  CRequestContext::EOnBadSessionID {
  CRequestContext::eOnBadSID_Allow , CRequestContext::eOnBadSID_AllowAndReport , CRequestContext::eOnBadSID_Ignore , CRequestContext::eOnBadSID_IgnoreAndReport ,
  CRequestContext::eOnBadSID_Throw
}
 Session ID error actions. More...
 
enum  CRequestContext::EProperty {
  CRequestContext::eProp_RequestID = 1 << 0 , CRequestContext::eProp_ClientIP = 1 << 1 , CRequestContext::eProp_SessionID = 1 << 2 , CRequestContext::eProp_HitID = 1 << 3 ,
  CRequestContext::eProp_ReqStatus = 1 << 4 , CRequestContext::eProp_BytesRd = 1 << 5 , CRequestContext::eProp_BytesWr = 1 << 6 , CRequestContext::eProp_Dtab = 1 << 7
}
 
enum  CRequestContext::FLoggedHitIDFlag { CRequestContext::fLoggedOnRequest = 1 , CRequestContext::fLoggedOnError = 2 }
 
enum  CRequestContext_PassThrough::EFormat { CRequestContext_PassThrough::eFormat_UrlEncoded }
 Supported serialization/deserialization formats. More...
 
enum  CRequestContextGuard_Base::EFlags { CRequestContextGuard_Base::fPrintRequestStart = 1 << 0 }
 
enum  CRequestContextException::EErrCode { CRequestContextException::eBadSession , CRequestContextException::eBadHit }
 Error types that CRequestContext can generate. More...
 
enum  CRequestStatus::ECode {
  CRequestStatus::e100_Continue = 100 , CRequestStatus::e101_SwitchingProtocols = 101 , CRequestStatus::e200_Ok = 200 , CRequestStatus::e201_Created = 201 ,
  CRequestStatus::e202_Accepted = 202 , CRequestStatus::e203_NonAuthInformation = 203 , CRequestStatus::e204_NoContent = 204 , CRequestStatus::e205_ResetContent = 205 ,
  CRequestStatus::e206_PartialContent = 206 , CRequestStatus::e299_PartialContentBrokenConnection = 299 , CRequestStatus::e300_MultipleChoices = 300 , CRequestStatus::e301_MovedPermanently = 301 ,
  CRequestStatus::e302_Found = 302 , CRequestStatus::e303_SeeOther = 303 , CRequestStatus::e304_NotModified = 304 , CRequestStatus::e305_UseProxy = 305 ,
  CRequestStatus::e307_TemporaryRedirect = 307 , CRequestStatus::e400_BadRequest = 400 , CRequestStatus::e401_Unauthorized = 401 , CRequestStatus::e402_PaymentRequired = 402 ,
  CRequestStatus::e403_Forbidden = 403 , CRequestStatus::e404_NotFound = 404 , CRequestStatus::e405_MethodNotAllowed = 405 , CRequestStatus::e406_NotAcceptable = 406 ,
  CRequestStatus::e407_ProxyAuthRequired = 407 , CRequestStatus::e408_RequestTimeout = 408 , CRequestStatus::e409_Conflict = 409 , CRequestStatus::e410_Gone = 410 ,
  CRequestStatus::e411_LengthRequired = 411 , CRequestStatus::e412_PreconditionFailed = 412 , CRequestStatus::e413_RequestEntityTooLarge = 413 , CRequestStatus::e414_RequestURITooLong = 414 ,
  CRequestStatus::e415_UnsupportedMediaType = 415 , CRequestStatus::e416_RangeNotSatisfiable = 416 , CRequestStatus::e417_ExpectationFailed = 417 , CRequestStatus::e422_UnprocessableEntity = 422 ,
  CRequestStatus::e451_Unavailable_For_Legal_Reasons = 451 , CRequestStatus::e499_BrokenConnection = 499 , CRequestStatus::e500_InternalServerError = 500 , CRequestStatus::e501_NotImplemented = 501 ,
  CRequestStatus::e502_BadGateway = 502 , CRequestStatus::e503_ServiceUnavailable = 503 , CRequestStatus::e504_GatewayTimeout = 504 , CRequestStatus::e505_HTTPVerNotSupported = 505
}
 
enum  CSysLog::EFlags {
  CSysLog::fNoOverride = 0x40000000 , CSysLog::fCopyToStderr = 0x20000000 , CSysLog::fFallBackToConsole = 0x10000000 , CSysLog::fIncludePID = 0x08000000 ,
  CSysLog::fConnectNow = 0x04000000 , CSysLog::fNoChildWait = 0x02000000 , CSysLog::fAllFlags = 0x7e000000
}
 
enum  CSysLog::EPriority {
  CSysLog::eEmergency , CSysLog::eAlert , CSysLog::eCritical , CSysLog::eError ,
  CSysLog::eWarning , CSysLog::eNotice , CSysLog::eInfo , CSysLog::eDebug
}
 
enum  CSysLog::EFacility {
  CSysLog::eDefaultFacility , CSysLog::eKernel , CSysLog::eUser , CSysLog::eMail ,
  CSysLog::eDaemon , CSysLog::eAuth , CSysLog::eSysLog , CSysLog::eLPR ,
  CSysLog::eNews , CSysLog::eUUCP , CSysLog::eCron , CSysLog::eAuthPriv ,
  CSysLog::eFTP , CSysLog::eLocal0 , CSysLog::eLocal1 , CSysLog::eLocal2 ,
  CSysLog::eLocal3 , CSysLog::eLocal4 , CSysLog::eLocal5 , CSysLog::eLocal6 ,
  CSysLog::eLocal7
}
 
enum  ENcbiLog_MTLock_Action { eNcbiLog_MT_Init , eNcbiLog_MT_Lock , eNcbiLog_MT_Unlock , eNcbiLog_MT_Destroy }
 The action passed to user defined MT lock handler. More...
 
enum  ENcbiLog_MTLock_Ownership { eNcbiLog_MT_NoOwnership , eNcbiLog_MT_TakeOwnership }
 Type of ownership for MT lock handle. More...
 
enum  ENcbiLog_Destination {
  eNcbiLog_Default , eNcbiLog_Stdlog , eNcbiLog_Cwd , eNcbiLog_File ,
  eNcbiLog_Stdout , eNcbiLog_Stderr , eNcbiLog_Disable
}
 Where to write the application's diagnostics to. More...
 
enum  ENcbiLog_Severity {
  eNcbiLog_Trace = 0 , eNcbiLog_Info , eNcbiLog_Warning , eNcbiLog_Error ,
  eNcbiLog_Critical , eNcbiLog_Fatal
}
 Severity level for the posted diagnostics. More...
 
enum  ENcbiLog_OnForkAction { fNcbiLog_OnFork_UpdateID = 0 , fNcbiLog_OnFork_PrintStart = 1 << 0 , fNcbiLog_OnFork_ResetTimer = 1 << 1 }
 Actions to perform in NcbiLog_UpdateOnFork() More...
 
enum  ENcbiLog_AppState {
  eNcbiLog_NotSet = 0 , eNcbiLog_AppBegin , eNcbiLog_AppRun , eNcbiLog_AppEnd ,
  eNcbiLog_RequestBegin , eNcbiLog_Request , eNcbiLog_RequestEnd
}
 Application execution states shown in the std prefix. More...
 

Functions

void SetDiagUserAndHost (TDiagUserAndHost flags=fDiag_AddUser|fDiag_AddHost)
 Set username and hostname properties for the diag context. More...
 
 CJaegerTracerSpan::CJaegerTracerSpan (shared_ptr< jaegertracing::Span > span)
 
jaegertracing::Span & CJaegerTracerSpan::GetSpan (void)
 
 CJaegerTracer::CJaegerTracer (void)
 Create tracer using default settings: More...
 
 CJaegerTracer::CJaegerTracer (const string &service_name)
 Create tracer using the service name and the environment varibles to populate configuration. More...
 
 CJaegerTracer::CJaegerTracer (const string &service_name, const jaegertracing::Config &config)
 Create tracer using the service name and config. More...
 
 CJaegerTracer::~CJaegerTracer (void)
 
void CJaegerTracer::OnRequestStart (CRequestContext &context) override
 
void CJaegerTracer::OnRequestStop (CRequestContext &context) override
 
 CDiagCompileInfo::CDiagCompileInfo (void)
 CDiagCompileInfo:: More...
 
 CDiagCompileInfo::CDiagCompileInfo (const char *file, int line, const char *curr_funct=NULL, const char *module=NULL)
 
 CDiagCompileInfo::CDiagCompileInfo (const string &file, int line, const string &curr_funct, const string &module)
 
 CDiagCompileInfo::~CDiagCompileInfo (void)
 
const char * CDiagCompileInfo::GetFile (void) const
 
const char * CDiagCompileInfo::GetModule (void) const
 
int CDiagCompileInfo::GetLine (void) const
 
const stringCDiagCompileInfo::GetClass (void) const
 
const stringCDiagCompileInfo::GetFunction (void) const
 
void CDiagCompileInfo::SetFile (const string &file)
 
void CDiagCompileInfo::SetModule (const string &module)
 
void CDiagCompileInfo::SetLine (int line)
 
void CDiagCompileInfo::SetFunction (const string &func)
 
void CDiagCompileInfo::SetClass (const string &cls)
 
void CDiagCompileInfo::ParseCurrFunctName (void) const
 
bool CDiagCompileInfo::x_NeedModule (void) const
 
const char * g_DiagUnknownFunction (void)
 
void CheckErrSubcodeX (int)
 Additional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro. More...
 
 ErrCode::ErrCode (int code, int subcode=0)
 Constructor. More...
 
 Severity::Severity (EDiagSev sev)
 
 SetPostFlags::SetPostFlags (TDiagPostFlags flags)
 
 MDiagModule::MDiagModule (const char *module)
 
 MDiagClass::MDiagClass (const char *nclass)
 
 MDiagFunction::MDiagFunction (const char *function)
 
 CNcbiDiag::CNcbiDiag (EDiagSev sev=eDiag_Error, TDiagPostFlags post_flags=eDPF_Default)
 Constructor. More...
 
 CNcbiDiag::CNcbiDiag (const CDiagCompileInfo &info, EDiagSev sev=eDiag_Error, TDiagPostFlags post_flags=eDPF_Default)
 Constructor – includes the file and line number info. More...
 
 CNcbiDiag::~CNcbiDiag (void)
 Destructor. More...
 
const CNcbiDiagCNcbiDiag::GetRef (void) const
 Some compilers (e.g. More...
 
template<class X >
const CNcbiDiagCNcbiDiag::Put (const volatile void *, const X &x) const
 Generic method to post to diagnostic stream. More...
 
const CNcbiDiagCNcbiDiag::Put (const ErrCode *, const ErrCode &err_code) const
 Helper method to post error code and subcode to diagnostic stream. More...
 
const CNcbiDiagCNcbiDiag::Put (const Severity *, const Severity &severity) const
 Helper method to set severity level. More...
 
template<class X >
const CNcbiDiagCNcbiDiag::Put (const CException *, const X &x) const
 Helper method to post an exception to diagnostic stream. More...
 
template<class X >
const CNcbiDiagCNcbiDiag::Put (const exception *, const X &x) const
 
const CNcbiDiagCNcbiDiag::Put (const CStackTrace *, const CStackTrace &stacktrace) const
 Helper method to post stack trace to diagnostic stream using standard stack trace formatting. More...
 
const CNcbiDiagCNcbiDiag::Put (const NCBI_NS_NCBI::SetPostFlags *, const NCBI_NS_NCBI::SetPostFlags &flags) const
 Helper method to set specific post flags. More...
 
const CNcbiDiagCNcbiDiag::Put (const FManip, const FManip &manip) const
 Helper method to handle various diagnostic stream manipulators. More...
 
const CNcbiDiagCNcbiDiag::operator<< (FManip manip) const
 
const CNcbiDiagCNcbiDiag::operator<< (FIosbaseManip manip) const
 
const CNcbiDiagCNcbiDiag::operator<< (FIosManip manip) const
 
template<class X >
const CNcbiDiagCNcbiDiag::operator<< (const X &x) const
 Post the arguments. More...
 
static const char * CNcbiDiag::SeverityName (EDiagSev sev)
 Get a common symbolic name for the severity levels. More...
 
static bool CNcbiDiag::StrToSeverityLevel (const char *str_sev, EDiagSev &sev)
 Get severity from string. More...
 
const CNcbiDiagCNcbiDiag::SetFile (const char *file) const
 Set file name to post. More...
 
const CNcbiDiagCNcbiDiag::SetModule (const char *module) const
 Set module name. More...
 
const CNcbiDiagCNcbiDiag::SetClass (const char *nclass) const
 Set class name. More...
 
const CNcbiDiagCNcbiDiag::SetFunction (const char *function) const
 Set function name. More...
 
const CNcbiDiagCNcbiDiag::SetLine (size_t line) const
 Set line number for post. More...
 
const CNcbiDiagCNcbiDiag::SetErrorCode (int code=0, int subcode=0) const
 Set error code and subcode numbers. More...
 
EDiagSev CNcbiDiag::GetSeverity (void) const
 Get severity of the current message. More...
 
const char * CNcbiDiag::GetFile (void) const
 Get file used for the current message. More...
 
size_t CNcbiDiag::GetLine (void) const
 Get line number for the current message. More...
 
int CNcbiDiag::GetErrorCode (void) const
 Get error code of the current message. More...
 
int CNcbiDiag::GetErrorSubCode (void) const
 Get error subcode of the current message. More...
 
const char * CNcbiDiag::GetModule (void) const
 Get module name of the current message. More...
 
const char * CNcbiDiag::GetClass (void) const
 Get class name of the current message. More...
 
const char * CNcbiDiag::GetFunction (void) const
 Get function name of the current message. More...
 
bool CNcbiDiag::CheckFilters (const CException *ex=NULL) const
 Check if filters are passed for the current message. More...
 
TDiagPostFlags CNcbiDiag::GetPostFlags (void) const
 Get post flags for the current message. More...
 
void CNcbiDiag::SetAllPostFlags (TDiagPostFlags flags) const
 Set new post flags for the current message. More...
 
TDiagPostFlags CNcbiDiag::SetPostFlags (TDiagPostFlags flags) const
 Set specific post flags for the current message. More...
 
TDiagPostFlags CNcbiDiag::ResetPostFlags (TDiagPostFlags flags) const
 Clear specific post flags for the current message. More...
 
static NCBI_XNCBI_EXPORT void CNcbiDiag::DiagFatal (const CDiagCompileInfo &info, const char *message)
 Display fatal error message. More...
 
static void CNcbiDiag::DiagTrouble (const CDiagCompileInfo &info, const char *message=NULL)
 Display trouble error message. More...
 
static NCBI_XNCBI_EXPORT void CNcbiDiag::DiagAssert (const CDiagCompileInfo &info, const char *expression, const char *message=NULL)
 Assert specified expression and report results. More...
 
static void CNcbiDiag::DiagAssertIfSuppressedSystemMessageBox (const CDiagCompileInfo &info, const char *expression, const char *message=NULL)
 Same as DiagAssert but only if the system message box is suppressed. More...
 
static void CNcbiDiag::DiagValidate (const CDiagCompileInfo &info, const char *expression, const char *message)
 Display validation message. More...
 
void CNcbiDiag::ResetIsMessageFlag (void) const
 
void CNcbiDiag::ResetIsNoteFlag (void) const
 Reset IsNote flag. More...
 
void CNcbiDiag::ResetIsConsoleFlag (void) const
 Reset IsConsole flag. More...
 
bool CNcbiDiag::GetOmitStackTrace (void) const
 
void CNcbiDiag::SetOmitStackTrace (bool value)
 
static TDiagPostFlags CNcbiDiag::ForceImportantFlags (TDiagPostFlags flags)
 Set important flags to their globally set values. More...
 
void CNcbiDiag::x_EndMess (void) const
 Private replacement for Endm called from manipulators. More...
 
const CNcbiDiagCNcbiDiag::x_Put (const CException &ex) const
 Helper func for the exception-related Put() More...
 
 CNcbiDiag::CNcbiDiag (const CNcbiDiag &)
 Private copy constructor to prohibit copy. More...
 
CNcbiDiagCNcbiDiag::operator= (const CNcbiDiag &)
 Private assignment operator to prohibit assignment. More...
 
bool IsSetDiagPostFlag (EDiagPostFlag flag, TDiagPostFlags flags=eDPF_Default)
 Check if a specified flag is set. More...
 
TDiagPostFlags SetDiagPostAllFlags (TDiagPostFlags flags)
 Set global post flags to "flags". More...
 
void SetDiagPostFlag (EDiagPostFlag flag)
 Set the specified flag (globally). More...
 
void UnsetDiagPostFlag (EDiagPostFlag flag)
 Unset the specified flag (globally). More...
 
TDiagPostFlags SetDiagTraceAllFlags (TDiagPostFlags flags)
 Versions of the above for extra trace flags. More...
 
void SetDiagTraceFlag (EDiagPostFlag flag)
 
void UnsetDiagTraceFlag (EDiagPostFlag flag)
 
 CDiagCollectGuard::CDiagCollectGuard (void)
 Set collectable severity and optionally applied print-severity cap to the current post level, Print severity is set to critical. More...
 
 CDiagCollectGuard::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::CDiagCollectGuard (EDiagSev print_severity, EDiagSev collect_severity, EAction action=eDiscard)
 Create diag collect guard with the given severities and action. More...
 
 CDiagCollectGuard::~CDiagCollectGuard (void)
 Destroy the guard, return post level to the one set before the guard initialization. More...
 
EDiagSev CDiagCollectGuard::GetPrintSeverity (void) const
 Get current print severity. More...
 
void CDiagCollectGuard::SetPrintSeverity (EDiagSev sev)
 Set new print severity. More...
 
EDiagSev CDiagCollectGuard::GetCollectSeverity (void) const
 Get current collect severity. More...
 
void CDiagCollectGuard::SetCollectSeverity (EDiagSev sev)
 Set new collect severity. More...
 
EDiagSev CDiagCollectGuard::GetSeverityCap (void) const
 Get current severity cap for use in ePrintCapped mode. More...
 
void CDiagCollectGuard::SetSeverityCap (EDiagSev sev)
 Set new severity cap for use in PrintCapped mode. More...
 
EAction CDiagCollectGuard::GetAction (void) const
 Get selected on-destroy action. More...
 
void CDiagCollectGuard::SetAction (EAction action)
 Specify on-destroy action. More...
 
Uint8 CDiagCollectGuard::GetStartingPoint (void) const
 Get the lowest thread-local post number in this guard's scope. More...
 
void CDiagCollectGuard::Release (void)
 Release the guard. More...
 
void CDiagCollectGuard::Release (EAction action)
 Release the guard. More...
 
void CDiagCollectGuard::x_Init (EDiagSev print_severity, EDiagSev collect_severity, EAction action)
 
void SetDiagPostPrefix (const char *prefix)
 Specify a string to prefix all subsequent error postings with. More...
 
void PushDiagPostPrefix (const char *prefix)
 Push a string to the list of message prefixes. More...
 
void PopDiagPostPrefix (void)
 Pop a string from the list of message prefixes. More...
 
Uint8 GetDiagRequestId (void)
 Get iteration number/request ID. More...
 
void SetDiagRequestId (Uint8 id)
 Set iteration number/request ID. More...
 
Uint8 GetFastCGIIteration (void)
 
void SetFastCGIIteration (Uint8 id)
 
 CDiagAutoPrefix::CDiagAutoPrefix (const string &prefix)
 Constructor. More...
 
 CDiagAutoPrefix::CDiagAutoPrefix (const char *prefix)
 Constructor. More...
 
 CDiagAutoPrefix::~CDiagAutoPrefix (void)
 Remove the prefix automagically, when the object gets out of scope. More...
 
EDiagSev SetDiagPostLevel (EDiagSev post_sev=eDiag_Error)
 Set the threshold severity for posting the messages. More...
 
EDiagSev GetDiagPostLevel (void)
 Get current threshold severity for posting the messages. More...
 
int CompareDiagPostLevel (EDiagSev sev1, EDiagSev sev2)
 Compare two severities. More...
 
bool IsVisibleDiagPostLevel (EDiagSev sev)
 Check if the specified severity is higher or equal to the currently selected post level and will be printed by ERR_POST. More...
 
bool DisableDiagPostLevelChange (bool disable_change=true)
 Disable change the diagnostic post level. More...
 
void SetDiagFixedPostLevel (EDiagSev post_sev)
 Sets and locks the level, combining the previous two calls. More...
 
EDiagSev SetDiagDieLevel (EDiagSev die_sev=eDiag_Fatal)
 Set the "die" (abort) level for the program. More...
 
EDiagSev GetDiagDieLevel (void)
 Get the "die" (abort) level for the program. More...
 
bool IgnoreDiagDieLevel (bool ignore)
 Ignore the die level settings. More...
 
void SetAbortHandler (FAbortHandler func=0)
 Set/unset abort handler. More...
 
NCBI_XNCBI_EXPORT void Abort (void)
 Smart abort function. More...
 
void SetDiagTrace (EDiagTrace how, EDiagTrace dflt=eDT_Default)
 Set the diagnostic trace settings. More...
 
bool GetDiagTrace (void)
 Check if traces are enabled. More...
 
virtual void INextDiagMessage::operator() (SDiagMessage &msg)=0
 
virtual INextDiagMessage::~INextDiagMessage (void)
 
 SDiagMessage::SDiagMessage (EDiagSev severity, const char *buf, size_t len, const char *file=0, size_t line=0, TDiagPostFlags flags=eDPF_Default, const char *prefix=0, int err_code=0, int err_subcode=0, const char *err_text=0, const char *module=0, const char *nclass=0, const char *function=0)
 Initialize SDiagMessage fields. More...
 
 SDiagMessage::SDiagMessage (const SDiagMessage &message)
 Copy constructor required to store the messages and flush them when the diagnostics setup is finished. More...
 
SDiagMessageSDiagMessage::operator= (const SDiagMessage &message)
 Assignment of messages. More...
 
 SDiagMessage::SDiagMessage (const string &message, bool *result=0)
 Parse a string back into SDiagMessage. More...
 
 SDiagMessage::~SDiagMessage (void)
 
bool SDiagMessage::ParseMessage (const string &message)
 Parse the whole string into the message. More...
 
static void SDiagMessage::ParseDiagStream (CNcbiIstream &in, INextDiagMessage &func)
 Stream parser. More...
 
static string SDiagMessage::GetEventName (EEventType event)
 
string SDiagMessage::FormatExtraMessage (void) const
 Convert extra arguments to string. More...
 
TUID SDiagMessage::GetUID (void) const
 Get UID from current context or parsed from a string. More...
 
CTime SDiagMessage::GetTime (void) const
 Get time and date - current or parsed. More...
 
void SDiagMessage::Write (string &str, TDiagWriteFlags flags=fNone) const
 Binary OR of "EDiagWriteFlags". More...
 
CNcbiOstreamSDiagMessage::Write (CNcbiOstream &os, TDiagWriteFlags fl=fNone) const
 Write to stream. More...
 
const stringSDiagMessage::GetHost (void) const
 Access to strings stored in SDiagMessageData. More...
 
string SDiagMessage::GetClient (void) const
 
string SDiagMessage::GetSession (void) const
 
const stringSDiagMessage::GetAppName (void) const
 
EDiagAppState SDiagMessage::GetAppState (void) const
 
CNcbiOstreamSDiagMessage::x_OldWrite (CNcbiOstream &os, TDiagWriteFlags fl=fNone) const
 
CNcbiOstreamSDiagMessage::x_NewWrite (CNcbiOstream &os, TDiagWriteFlags fl=fNone) const
 
string SDiagMessage::x_GetModule (void) const
 
static void SDiagMessage::s_EscapeNewlines (string &buf)
 
static void SDiagMessage::s_UnescapeNewlines (string &buf)
 
bool SDiagMessage::x_ParseExtraArgs (const string &str, size_t pos)
 
void SDiagMessage::x_SetFormat (EFormatFlag fmt) const
 
bool SDiagMessage::x_IsSetOldFormat (void) const
 
void SDiagMessage::x_InitData (void) const
 
void SDiagMessage::x_SaveContextData (void) const
 
CNcbiOstreamoperator<< (CNcbiOstream &os, const SDiagMessage &mess)
 Insert message in output stream. More...
 
 CDiagContext_Extra::~CDiagContext_Extra (void)
 Prints all arguments as "name1=value1&name2=value2...". More...
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, const string &value)
 The method does not print the argument, but adds it to the string. More...
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, const char *value)
 Overloaded Print() for all types. More...
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, int value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, unsigned int value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, long value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, unsigned long value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, Int8 value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, Uint8 value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, char value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, signed char value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, unsigned char value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, double value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, bool value)
 
template<class TKey , class TStorage >
CDiagContext_ExtraCDiagContext_Extra::Print (const string &name, const CStrictId< TKey, TStorage > &value)
 
CDiagContext_ExtraCDiagContext_Extra::Print (TExtraArgs &args)
 The method does not print the arguments, but adds it to the string. More...
 
 CDiagContext_Extra::CDiagContext_Extra (const CDiagContext_Extra &args)
 Copying the object will prevent printing it on destruction. More...
 
CDiagContext_ExtraCDiagContext_Extra::operator= (const CDiagContext_Extra &args)
 
void CDiagContext_Extra::Flush (void)
 Print the message and reset object. More...
 
CDiagContext_ExtraCDiagContext_Extra::SetType (const string &type)
 Set extra message type. More...
 
CDiagContext_ExtraCDiagContext_Extra::AllowBadSymbolsInArgNames (void)
 Allow bad symbols in argument names. More...
 
void CDiagContext_Extra::x_Release (void)
 
bool CDiagContext_Extra::x_CanPrint (void)
 
 CDiagContext_Extra::CDiagContext_Extra (SDiagMessage::EEventType event_type)
 
 CDiagContext_Extra::CDiagContext_Extra (int status, double timespan, TExtraArgs &args)
 
CDiagContext_ExtraCDiagContext_Extra::PrintNcbiRoleAndLocation (void)
 
CDiagContext_ExtraCDiagContext_Extra::PrintNcbiAppInfoOnStart (void)
 
CDiagContext_ExtraCDiagContext_Extra::PrintNcbiAppInfoOnRequest (void)
 
 CDiagContext::CDiagContext (void)
 
 CDiagContext::~CDiagContext (void)
 
static TPID CDiagContext::GetPID (void)
 Get cached PID (read real PID if not cached yet). More...
 
static bool CDiagContext::UpdatePID (void)
 Reset PID cache (e.g. after fork). Return true if PID was updated. More...
 
static bool CDiagContext::UpdatePID_AsyncSafe (void)
 
static void CDiagContext::UpdateOnFork (TOnForkFlags flags)
 Update diagnostics after fork(). More...
 
TUID CDiagContext::GetUID (void) const
 Return (create if not created yet) unique diagnostic ID. More...
 
string CDiagContext::GetStringUID (TUID uid=0) const
 Return string representation of UID. More...
 
TUID CDiagContext::UpdateUID (TUID uid=0) const
 Take the source UID and replace its timestamp part with the current time. More...
 
void CDiagContext::GetStringUID (TUID uid, char *buf, size_t buf_len) const
 Fill buffer with string representation of UID. More...
 
void CDiagContext::GetStringUID (TUID uid, char *buf) const
 
string CDiagContext::GetNextHitID (void) const
 Create global unique request id. More...
 
string CDiagContext::GetGlobalRequestId (void) const
 Deprecated version of HID generator. More...
 
static CRequestContextCDiagContext::GetRequestContext (void)
 Shortcut to CDiagContextThreadData::GetThreadData().GetRequestContext() More...
 
static void CDiagContext::SetRequestContext (CRequestContext *ctx)
 Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext() More...
 
void CDiagContext::SetAutoWrite (bool value)
 Set AutoWrite flag. More...
 
void CDiagContext::SetProperty (const string &name, const string &value, EPropertyMode mode=eProp_Default)
 Set application context property by name. More...
 
string CDiagContext::GetProperty (const string &name, EPropertyMode mode=eProp_Default) const
 Get application context property by name, return empty string if the property is not set. More...
 
void CDiagContext::DeleteProperty (const string &name, EPropertyMode mode=eProp_Default)
 Delete a property by name. More...
 
void CDiagContext::PrintProperties (void)
 Forced dump of all set properties. More...
 
void CDiagContext::PrintStart (const string &message)
 Print start/stop etc. More...
 
void CDiagContext::PrintStop (void)
 Print exit message. More...
 
void CDiagContext::PrintExtra (const string &message)
 Print extra message in plain text format. More...
 
CDiagContext_Extra CDiagContext::Extra (void) const
 Create a temporary CDiagContext_Extra object. More...
 
void CDiagContext::PrintRequestStart (const string &message)
 Print request start message (for request-driven applications) More...
 
CDiagContext_Extra CDiagContext::PrintRequestStart (void)
 Create a temporary CDiagContext_Extra object. More...
 
void CDiagContext::PrintRequestStop (void)
 Print request stop message (for request-driven applications) More...
 
EDiagAppState CDiagContext::GetGlobalAppState (void) const
 Always returns global application state. More...
 
void CDiagContext::SetGlobalAppState (EDiagAppState state)
 Set global application state. More...
 
EDiagAppState CDiagContext::GetAppState (void) const
 Return application state for the current thread if it's set. More...
 
void CDiagContext::SetAppState (EDiagAppState state)
 Set application state. More...
 
void CDiagContext::SetAppState (EDiagAppState state, EPropertyMode mode)
 The 'mode' flag is deprecated. More...
 
static bool CDiagContext::IsSetOldPostFormat (void)
 Check old/new format flag (for compatibility only) More...
 
static void CDiagContext::SetOldPostFormat (bool value)
 Set old/new format flag. More...
 
static bool CDiagContext::IsUsingSystemThreadId (void)
 Check if system TID is printed instead of CThread::GetSelf() More...
 
static void CDiagContext::UseSystemThreadId (bool value=true)
 Switch printing system TID (rather than CThread::GetSelf()) on/off. More...
 
const stringCDiagContext::GetUsername (void) const
 Get username. More...
 
void CDiagContext::SetUsername (const string &username)
 Set username. More...
 
const stringCDiagContext::GetHost (void) const
 Get host name. More...
 
const stringCDiagContext::GetEncodedHost (void) const
 URL-encoded version of GetHost() More...
 
const stringCDiagContext::GetHostname (void) const
 Get cached hostname - do not try to detect host name as GetHost() does. More...
 
const stringCDiagContext::GetEncodedHostname (void) const
 Get URL-encoded hostname. More...
 
void CDiagContext::SetHostname (const string &hostname)
 Set hostname. More...
 
const stringCDiagContext::GetHostIP (void) const
 Get host IP address. More...
 
void CDiagContext::SetHostIP (const string &ip)
 Set host IP address. More...
 
const stringCDiagContext::GetAppName (void) const
 Get application name. More...
 
const stringCDiagContext::GetEncodedAppName (void) const
 Get URL-encoded application name. More...
 
void CDiagContext::SetAppName (const string &app_name)
 Set application name. More...
 
bool CDiagContext::IsSetExitCode (void) const
 Check if exit code has been set. More...
 
int CDiagContext::GetExitCode (void) const
 Get exit code. More...
 
void CDiagContext::SetExitCode (int exit_code)
 Set exit code. More...
 
int CDiagContext::GetExitSignal (void) const
 Get exit signal. More...
 
void CDiagContext::SetExitSignal (int exit_sig)
 Set exit signal. More...
 
string CDiagContext::GetDefaultSessionID (void) const
 Get default session id. More...
 
void CDiagContext::SetDefaultSessionID (const string &session_id)
 Set new default session id. More...
 
string CDiagContext::GetSessionID (void) const
 Get the effective session id: the per-request session id if set, or the default session id. More...
 
string CDiagContext::GetEncodedSessionID (void) const
 Get url-encoded session id. More...
 
static string CDiagContext::GetDefaultClientIP (void)
 Get default client ip. More...
 
static void CDiagContext::SetDefaultClientIP (const string &client_ip)
 Set new default client ip. More...
 
string CDiagContext::GetDefaultHitID (void) const
 Get global default hit id. More...
 
void CDiagContext::SetDefaultHitID (const string &hit_id)
 Set new global default hit id. More...
 
static const stringCDiagContext::GetHostRole (void)
 Get host role (DEV/QA/TRY/PROD) from /etc/ncbi/role. More...
 
static const stringCDiagContext::GetHostLocation (void)
 Get host location (be-md/st-va) from /etc/ncbi/location. More...
 
void CDiagContext::WriteStdPrefix (CNcbiOstream &ostr, const SDiagMessage &msg) const
 Write standard prefix to the stream. More...
 
void CDiagContext::InitMessages (size_t max_size=100)
 Start collecting all messages (the collected messages can be flushed to a new destination later). More...
 
void CDiagContext::PushMessage (const SDiagMessage &message)
 Save new message. More...
 
void CDiagContext::FlushMessages (CDiagHandler &handler)
 Flush the collected messages to the current diag handler. More...
 
void CDiagContext::DiscardMessages (void)
 Discard the collected messages without printing them. More...
 
bool CDiagContext::IsCollectingMessages (void) const
 Check if message collecting is on. More...
 
static bool CDiagContext::GetLogTruncate (void)
 Get log file truncation flag. More...
 
static void CDiagContext::SetLogTruncate (bool value)
 Set log file truncation flag. More...
 
static void CDiagContext::SetUseRootLog (void)
 @depracated The flag is always set now, the funcion still calls SetupDiag() for compatibility, but has no other effects. More...
 
static bool CDiagContext::IsUsingRootLog (void)
 Check if the current diagnostics destination is /log/*. More...
 
static void CDiagContext::SetupDiag (EAppDiagStream ds=eDS_Default, CNcbiRegistry *config=NULL, EDiagCollectMessages collect=eDCM_NoChange, const char *cmd_logfile=NULL)
 Application-wide diagnostics setup. More...
 
static TCount CDiagContext::GetProcessPostNumber (EPostNumberIncrement inc)
 Return process post number (incrementing depends on the flag). More...
 
static TCount CDiagContext::GetThreadPostNumber (EPostNumberIncrement inc)
 Return thread post number (incrementing depends on the flag). More...
 
static TTID CDiagContext::GetTID (void)
 
unsigned int CDiagContext::GetLogRate_Limit (ELogRate_Type type) const
 Logging rate control - max number of messages per period. More...
 
void CDiagContext::SetLogRate_Limit (ELogRate_Type type, unsigned int limit)
 
unsigned int CDiagContext::GetLogRate_Period (ELogRate_Type type) const
 Logging rate control - the messages control period, seconds. More...
 
void CDiagContext::SetLogRate_Period (ELogRate_Type type, unsigned int period)
 
static void CDiagContext::x_FinalizeSetupDiag (void)
 Internal function, should be used only by CNcbiApplication. More...
 
static bool CDiagContext::IsApplogSeverityLocked (void)
 When using applog, the diag post level is locked to Warning. More...
 
static void CDiagContext::SetApplogSeverityLocked (bool lock)
 
static bool CDiagContext::IsMainThreadDataInitialized (void)
 
 CDiagContext::CDiagContext (const CDiagContext &)
 
CDiagContextCDiagContext::operator= (const CDiagContext &)
 
void CDiagContext::x_CreateUID (void) const
 
void CDiagContext::x_CreateUID_AsyncSafe (void) const
 
void CDiagContext::x_PrintMessage (SDiagMessage::EEventType event, const string &message)
 
static void CDiagContext::x_StartRequest (void)
 
static void CDiagContext::x_LogEnvironment (void)
 
void CDiagContext::ResetLogRates (void)
 
bool CDiagContext::ApproveMessage (SDiagMessage &msg, bool *show_warning)
 
static void CDiagContext::sx_ThreadDataTlsCleanup (CDiagContextThreadData *value, void *cleanup_data)
 
bool CDiagContext::x_DiagAtApplicationLevel (void) const
 
bool CDiagContext::x_IsSetDefaultHitID (void) const
 
CSharedHitId CDiagContext::x_GetDefaultHitID (EDefaultHitIDFlags flag) const
 
string CDiagContext::x_GetNextHitID (bool is_default) const
 
void CDiagContext::x_LogHitID (void) const
 
void CDiagContext::x_LogHitID_WithLock (void) const
 
CDiagContextGetDiagContext (void)
 Get diag context instance. More...
 
 CNcbiLogFields::CNcbiLogFields (const string &source)
 Load fields to be logged from NCBI_LOG_FIELDS environment variable. More...
 
 CNcbiLogFields::~CNcbiLogFields (void)
 
template<class TEntries >
void CNcbiLogFields::LogFields (const TEntries &entries) const
 Log (as an extra) all names/values matching fields in NCBI_LOG_FIELDS. More...
 
void CNcbiLogFields::x_Match (const string &name, const string &value, CDiagContext_Extra &extra) const
 
virtual CDiagHandler::~CDiagHandler (void)
 Destructor. More...
 
virtual void CDiagHandler::Post (const SDiagMessage &mess)=0
 Post message to handler. More...
 
virtual void CDiagHandler::PostToConsole (const SDiagMessage &mess)
 Post message to console regardless of its severity. More...
 
virtual bool CDiagHandler::AllowAsyncWrite (const SDiagMessage &msg) const
 Check if the handler supports async writes. More...
 
virtual string CDiagHandler::ComposeMessage (const SDiagMessage &msg, EDiagFileType *file_type) const
 Compose message without writing it. More...
 
virtual void CDiagHandler::WriteMessage (const char *buf, size_t len, EDiagFileType file_type)
 Write string to the log. More...
 
virtual string CDiagHandler::GetLogName (void)
 Get current diag posts destination. More...
 
virtual void CDiagHandler::Reopen (TReopenFlags)
 Reopen file to enable log rotation. More...
 
void SetDiagHandler (CDiagHandler *handler, bool can_delete=true)
 Set the diagnostic handler using the specified diagnostic handler class. More...
 
CDiagHandlerGetDiagHandler (bool take_ownership=false, bool *current_ownership=0)
 Get the currently set diagnostic handler class. More...
 
void SetDiagHandler (FDiagHandler func, void *data, FDiagCleanup cleanup)
 Set the diagnostic handler using the specified diagnostic handler and cleanup functions. More...
 
bool IsSetDiagHandler (void)
 Check if diagnostic handler is set. More...
 
void DiagHandler_Reopen (void)
 Ask diagnostic handler to reopen log files if necessary. More...
 
void SetDiagFilter (EDiagFilter what, const char *filter_str)
 Set diagnostic filter. More...
 
string GetDiagFilter (EDiagFilter what)
 Get current diagnostic filter. More...
 
void AppendDiagFilter (EDiagFilter what, const char *filter_str)
 Append diagnostic filter. More...
 
 CStreamDiagHandler_Base::CStreamDiagHandler_Base (void)
 
virtual string CStreamDiagHandler_Base::GetLogName (void)
 Get current diag posts destination. More...
 
virtual CNcbiOstreamCStreamDiagHandler_Base::GetStream (void)
 
void CStreamDiagHandler_Base::SetLogName (const string &log_name)
 
 CStreamDiagHandler::CStreamDiagHandler (CNcbiOstream *os, bool quick_flush=true, const string &stream_name="")
 Constructor. More...
 
virtual void CStreamDiagHandler::Post (const SDiagMessage &mess)
 Post message to the handler. More...
 
virtual CNcbiOstreamCStreamDiagHandler::GetStream (void)
 
 CFileHandleDiagHandler::CFileHandleDiagHandler (const string &fname, EDiagFileType file_type=eDiagFile_All)
 Constructor. More...
 
 CFileHandleDiagHandler::~CFileHandleDiagHandler (void)
 Close file handle. More...
 
virtual void CFileHandleDiagHandler::Post (const SDiagMessage &mess)
 Post message to the handler. More...
 
virtual bool CFileHandleDiagHandler::AllowAsyncWrite (const SDiagMessage &msg) const
 Check if the handler supports async writes. More...
 
virtual string CFileHandleDiagHandler::ComposeMessage (const SDiagMessage &msg, EDiagFileType *file_type) const
 Compose message without writing it. More...
 
virtual void CFileHandleDiagHandler::WriteMessage (const char *buf, size_t len, EDiagFileType file_type)
 Write string to the log. More...
 
bool CFileHandleDiagHandler::Valid (void)
 
virtual void CFileHandleDiagHandler::Reopen (TReopenFlags flags)
 Reopen file to enable log rotation. More...
 
virtual void CFileHandleDiagHandler::SetLogName (const string &log_name)
 
 CFileDiagHandler::CFileDiagHandler (void)
 Constructor. More...
 
 CFileDiagHandler::~CFileDiagHandler (void)
 
virtual void CFileDiagHandler::Post (const SDiagMessage &mess)
 Post message to the handler. More...
 
virtual bool CFileDiagHandler::AllowAsyncWrite (const SDiagMessage &msg) const
 Check if the handler supports async writes. More...
 
virtual string CFileDiagHandler::ComposeMessage (const SDiagMessage &msg, EDiagFileType *file_type) const
 Compose message without writing it. More...
 
virtual void CFileDiagHandler::WriteMessage (const char *buf, size_t len, EDiagFileType file_type)
 Write string to the log. More...
 
bool CFileDiagHandler::SetLogFile (const string &file_name, EDiagFileType file_type, bool quick_flush)
 Set new log file. More...
 
string CFileDiagHandler::GetLogFile (EDiagFileType file_type) const
 Get current log file name. More...
 
CNcbiOstreamCFileDiagHandler::GetLogStream (EDiagFileType file_type)
 Get current log stream. More...
 
virtual void CFileDiagHandler::Reopen (TReopenFlags flags)
 Reopen file to enable log rotation. More...
 
void CFileDiagHandler::SetSubHandler (CStreamDiagHandler_Base *handler, EDiagFileType file_type, bool own)
 
void CFileDiagHandler::SetOwnership (CStreamDiagHandler_Base *handler, bool own)
 Change ownership for the given handler if it's currently installed. More...
 
virtual void CFileDiagHandler::SetLogName (const string &log_name)
 
EDiagFileType CFileDiagHandler::x_GetDiagFileType (const SDiagMessage &msg) const
 
CStreamDiagHandler_BaseCFileDiagHandler::x_GetHandler (EDiagFileType file_type) const
 
void CFileDiagHandler::x_ResetHandler (CStreamDiagHandler_Base **ptr, bool *owned)
 
void CFileDiagHandler::x_SetHandler (CStreamDiagHandler_Base **member, bool *own_member, CStreamDiagHandler_Base *handler, bool own)
 
 CAsyncDiagHandler::CAsyncDiagHandler (void)
 
virtual CAsyncDiagHandler::~CAsyncDiagHandler (void)
 
void CAsyncDiagHandler::InstallToDiag (void)
 Install this DiagHandler into diagnostics. More...
 
void CAsyncDiagHandler::RemoveFromDiag (void)
 Remove this DiagHandler from diagnostics. More...
 
void CAsyncDiagHandler::SetCustomThreadSuffix (const string &suffix)
 Set custom suffix to use on all threads in the server's pool. More...
 
virtual void CAsyncDiagHandler::Post (const SDiagMessage &mess)
 Implementation of CDiagHandler. More...
 
virtual string CAsyncDiagHandler::GetLogName (void)
 Get current diag posts destination. More...
 
virtual void CAsyncDiagHandler::Reopen (TReopenFlags flags)
 Reopen file to enable log rotation. More...
 
void SetDoubleDiagHandler (void)
 Output diagnostics using both old and new style handlers. More...
 
void SetDiagStream (CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
 Set diagnostic stream. More...
 
bool IsDiagStream (const CNcbiOstream *os)
 
CNcbiOstreamGetDiagStream (void)
 Get current diagnostic stream (if it was set by SetDiagStream) or NULL. More...
 
void SetSplitLogFile (bool value=true)
 Split log files flag. More...
 
bool GetSplitLogFile (void)
 Get split log files flag. More...
 
bool SetLogFile (const string &file_name, EDiagFileType file_type=eDiagFile_All, bool quick_flush=true)
 Set log files. More...
 
string GetLogFile (EDiagFileType file_type)
 Get log file name for the given log type. More...
 
string GetLogFile (void)
 Get log file name or diag handler name. More...
 
void g_Diag_Use_RWLock (bool enable=true)
 Use RW-lock for synchronization rather than mutex. More...
 
virtual CDiagFactory::~CDiagFactory ()
 
virtual CDiagHandlerCDiagFactory::New (const string &s)=0
 Factory method interface. More...
 
 CDiagRestorer::CDiagRestorer (void)
 Captures current settings. More...
 
 CDiagRestorer::~CDiagRestorer (void)
 Restores captured settings. More...
 
void * CDiagRestorer::operator new (size_t)
 Private new operator. More...
 
void * CDiagRestorer::operator new[] (size_t)
 Private new[] operator. More...
 
void CDiagRestorer::operator delete (void *)
 Private delete operator. More...
 
void CDiagRestorer::operator delete[] (void *)
 Private delete[] operator. More...
 
 SDiagErrCodeDescription::SDiagErrCodeDescription (void)
 Constructor. More...
 
 SDiagErrCodeDescription::SDiagErrCodeDescription (const string &message, const string &explanation, int severity=-1)
 Destructor. More...
 
 CDiagErrCodeInfo::CDiagErrCodeInfo (void)
 Constructor. More...
 
 CDiagErrCodeInfo::CDiagErrCodeInfo (const string &file_name)
 Constructor – can throw runtime_error. More...
 
 CDiagErrCodeInfo::CDiagErrCodeInfo (CNcbiIstream &is)
 Constructor – can throw runtime_error. More...
 
 CDiagErrCodeInfo::~CDiagErrCodeInfo (void)
 Destructor. More...
 
bool CDiagErrCodeInfo::Read (const string &file_name)
 Read error description from specified file. More...
 
bool CDiagErrCodeInfo::Read (CNcbiIstream &is)
 Read error description from specified stream. More...
 
void CDiagErrCodeInfo::Clear (void)
 Delete all stored error descriptions from memory. More...
 
bool CDiagErrCodeInfo::GetDescription (const ErrCode &err_code, SDiagErrCodeDescription *description) const
 Get description for specified error code. More...
 
void CDiagErrCodeInfo::SetDescription (const ErrCode &err_code, const SDiagErrCodeDescription &description)
 Set error description for specified error code. More...
 
bool CDiagErrCodeInfo::HaveDescription (const ErrCode &err_code) const
 Check if error description exists. More...
 
void SetDiagErrCodeInfo (CDiagErrCodeInfo *info, bool can_delete=true)
 Set handler for processing error codes. More...
 
bool IsSetDiagErrCodeInfo ()
 Indicates whether an error-code processing handler has been set. More...
 
CDiagErrCodeInfoGetDiagErrCodeInfo (bool take_ownership=false)
 Get handler for processing error codes. More...
 
 CPerfLogger::CPerfLogger (EStart state=eStart)
 Constructor. Starts the timer by default. More...
 
 CPerfLogger::CPerfLogger (const CTime &start_time, double elapsed_time, EStart state=eStart)
 Constructor. More...
 
 CPerfLogger::CPerfLogger (CStopWatch &stopwatch, EStart state=eStart)
 Constructor. More...
 
void CPerfLogger::Start (void)
 Activate and start (or, restart after Suspend()) the timer. More...
 
void CPerfLogger::Suspend (void)
 Suspend the timer. More...
 
CDiagContext_Extra CPerfLogger::Post (CRequestStatus::ECode status, CTempString resource, CTempString status_msg=CTempString())
 Log the timing; stop and deactivate the timer. More...
 
CDiagContext_Extra CPerfLogger::Post (int status, CTempString resource, CTempString status_msg=CTempString())
 
void CPerfLogger::Discard (void)
 Discard the timing results; stop and deactivate the timer. More...
 
 CPerfLogger::~CPerfLogger ()
 If the timer is still active, then post an error (once). More...
 
static bool CPerfLogger::IsON (void)
 Is performance logging on, globally? Controlled by CParam(section="Log", entry="PerfLogging", default=false) More...
 
static void CPerfLogger::SetON (bool enable=true)
 Turn performance logging on/off globally. More...
 
void CPerfLogger::Adjust (CTimeSpan timespan)
 Adjust the printed elapsed time. More...
 
const CTimeCPerfLogger::GetLoggerStartTime (void) const
 Get the logger's start time. More...
 
double CPerfLogger::GetElapsedTime (void) const
 Get total elapsed time (including any adjustments) in seconds. More...
 
bool CPerfLogger::x_CheckValidity (const CTempString &err_msg) const
 
 CPerfLogGuard::CPerfLogGuard (CTempString resource, CPerfLogger::EStart state=CPerfLogger::eStart)
 Constructor. More...
 
 CPerfLogGuard::CPerfLogGuard (CTempString resource, const CTime &start_time, double elapsed_time, CPerfLogger::EStart state=CPerfLogger::eStart)
 Constructor. More...
 
 CPerfLogGuard::CPerfLogGuard (CTempString resource, CStopWatch &stopwatch, CPerfLogger::EStart state=CPerfLogger::eStart)
 Constructor. More...
 
void CPerfLogGuard::Start (void)
 Activate and start (or, restart after Suspend()) the timer. More...
 
void CPerfLogGuard::Suspend (void)
 Suspend the timer. More...
 
CPerfLogGuardCPerfLogGuard::AddParameter (CTempString name, CTempString value)
 Add info to the resource's description. More...
 
void CPerfLogGuard::Post (CRequestStatus::ECode status, CTempString status_msg=CTempString())
 Write the collected resource info and timing to the log. More...
 
void CPerfLogGuard::Post (int status, CTempString status_msg=CTempString())
 
void CPerfLogGuard::Discard (void)
 Discard the results. More...
 
 CPerfLogGuard::~CPerfLogGuard ()
 If Post() or Discard() have not been called, then log the collected info with status 500. More...
 
CPerfLoggerCPerfLogGuard::GetLogger (void)
 Access logger directly. More...
 
 CSharedHitId::CSharedHitId (const string &hit_id)
 Set new hit id, checks its validity. More...
 
 CSharedHitId::CSharedHitId (void)
 
 CSharedHitId::~CSharedHitId (void)
 
bool CSharedHitId::Empty (void) const
 
void CSharedHitId::SetShared (void) const
 Mark this hit id as a shared one and start using shared counter. More...
 
bool CSharedHitId::IsShared (void) const
 Check if shared counter is used. More...
 
const stringCSharedHitId::GetHitId (void) const
 Get hit id value. More...
 
void CSharedHitId::SetHitId (const string &hit_id)
 Set new hit id value. This resets sub-hit counter and makes it non-shared. More...
 
TSubHitId CSharedHitId::GetCurrentSubHitId (void) const
 Get current sub-hit id value. More...
 
TSubHitId CSharedHitId::GetNextSubHitId (void)
 Get next sub-hit id value. More...
 
bool CSharedHitId::IsRequestLevel (void) const
 Check if this hit ID was set at request level. More...
 
void CSharedHitId::x_SetHitId (const string &hit_id)
 Set new hit id, checks its validity. More...
 
virtual IRequestTracer::~IRequestTracer (void)
 
virtual void IRequestTracer::OnRequestStart (CRequestContext &context)=0
 
virtual void IRequestTracer::OnRequestStop (CRequestContext &context)=0
 
virtual ITracerSpan::~ITracerSpan (void)
 
 CRequestContext::CRequestContext (TContextFlags flags=fDefault)
 
virtual CRequestContext::~CRequestContext (void)
 
TCount CRequestContext::GetRequestID (void) const
 Get request ID (or zero if not set). More...
 
void CRequestContext::SetRequestID (TCount rid)
 Set request ID. More...
 
bool CRequestContext::IsSetRequestID (void) const
 Check if request ID was assigned a value. More...
 
void CRequestContext::UnsetRequestID (void)
 Reset request ID. More...
 
TCount CRequestContext::SetRequestID (void)
 Assign the next available request ID to this request. More...
 
static TCount CRequestContext::GetNextRequestID (void)
 Return the next available application-wide request ID. More...
 
EDiagAppState CRequestContext::GetAppState (void) const
 Application state. More...
 
void CRequestContext::SetAppState (EDiagAppState state)
 
string CRequestContext::GetClientIP (void) const
 Client IP/hostname. More...
 
void CRequestContext::SetClientIP (const string &client)
 
bool CRequestContext::IsSetClientIP (void) const
 
bool CRequestContext::IsSetExplicitClientIP (void) const
 
void CRequestContext::UnsetClientIP (void)
 
string CRequestContext::GetSessionID (void) const
 Session ID. More...
 
void CRequestContext::SetSessionID (const string &session)
 
bool CRequestContext::IsSetSessionID (void) const
 
bool CRequestContext::IsSetExplicitSessionID (void) const
 Does not check default SID. More...
 
void CRequestContext::UnsetSessionID (void)
 
const stringCRequestContext::SetSessionID (void)
 Create and set new session ID. More...
 
string CRequestContext::GetEncodedSessionID (void) const
 Get URL-encoded session ID. More...
 
string CRequestContext::GetHitID (void) const
 Get explicit hit id or the default one (from HTTP_NCBI_PHID etc). More...
 
void CRequestContext::SetHitID (const string &hit)
 Set explicit hit id. The id is reset on request end. More...
 
bool CRequestContext::IsSetHitID (EHitIDSource src=eHitID_Any) const
 Check if there's an explicit hit id or the default one. More...
 
bool CRequestContext::IsSetExplicitHitID (void) const
 Check if there's an explicit hit id. More...
 
void CRequestContext::UnsetHitID (void)
 Reset explicit hit id. More...
 
const stringCRequestContext::SetHitID (void)
 Generate unique hit id, assign it to this request, return the hit id value. More...
 
const stringCRequestContext::GetNextSubHitID (CTempString prefix=CTempString())
 Get current hit id appended with auto-incremented sub-hit id. More...
 
const stringCRequestContext::GetCurrentSubHitID (CTempString prefix=CTempString())
 Get the last generated sub-hit id. More...
 
bool CRequestContext::IsSetDtab (void) const
 Dtab. More...
 
const stringCRequestContext::GetDtab (void) const
 
void CRequestContext::SetDtab (const string &dtab)
 
void CRequestContext::UnsetDtab (void)
 
int CRequestContext::GetRequestStatus (void) const
 Request exit status. More...
 
void CRequestContext::SetRequestStatus (int status)
 
void CRequestContext::SetRequestStatus (CRequestStatus::ECode code)
 
bool CRequestContext::IsSetRequestStatus (void) const
 
void CRequestContext::UnsetRequestStatus (void)
 
const CStopWatchCRequestContext::GetRequestTimer (void) const
 Request execution timer. More...
 
CStopWatchCRequestContext::GetRequestTimer (void)
 
Int8 CRequestContext::GetBytesRd (void) const
 Bytes read. More...
 
void CRequestContext::SetBytesRd (Int8 bytes)
 
bool CRequestContext::IsSetBytesRd (void) const
 
void CRequestContext::UnsetBytesRd (void)
 
Int8 CRequestContext::GetBytesWr (void) const
 Bytes written. More...
 
void CRequestContext::SetBytesWr (Int8 bytes)
 
bool CRequestContext::IsSetBytesWr (void) const
 
void CRequestContext::UnsetBytesWr (void)
 
void CRequestContext::Reset (void)
 Reset all properties to the initial state. More...
 
void CRequestContext::SetProperty (const string &name, const string &value)
 Add/change property. More...
 
const stringCRequestContext::GetProperty (const string &name) const
 Get property value or empty string. More...
 
bool CRequestContext::IsSetProperty (const string &name) const
 Check if the property has a value (even if it's an empty string). More...
 
void CRequestContext::UnsetProperty (const string &name)
 Remove property from the map. More...
 
const TPropertiesCRequestContext::GetProperties (void) const
 Get all properties (read only) More...
 
TPropertiesCRequestContext::GetProperties (void)
 Get all properties (non-const) More...
 
void CRequestContext::SetAutoIncRequestIDOnPost (bool enable)
 Auto-increment request ID with every posted message. More...
 
bool CRequestContext::GetAutoIncRequestIDOnPost (void) const
 Get auto-increment state. More...
 
static void CRequestContext::SetDefaultAutoIncRequestIDOnPost (bool enable)
 Set default auto-increment flag used for each default request context. More...
 
static bool CRequestContext::GetDefaultAutoIncRequestIDOnPost (void)
 Get default auto-increment flag. More...
 
static bool CRequestContext::IsValidSessionID (const string &session_id)
 Check if session id fits the allowed format. More...
 
static EOnBadSessionID CRequestContext::GetBadSessionIDAction (void)
 Get/set session id error action. More...
 
static void CRequestContext::SetBadSessionIDAction (EOnBadSessionID action)
 
static ESessionIDFormat CRequestContext::GetAllowedSessionIDFormat (void)
 Get/set allowed session id format. More...
 
static void CRequestContext::SetAllowedSessionIDFormat (ESessionIDFormat fmt)
 
CRef< CRequestContextCRequestContext::Clone (void) const
 Copy current request context to a new one. More...
 
static string CRequestContext::SelectLastHitID (const string &hit_ids)
 Select the last hit id from the list of ids separated with commas and optional spaces. More...
 
static string CRequestContext::SelectLastSessionID (const string &session_ids)
 Select the last session id from the list of ids separated with commas and optional spaces, ignore UNK_SESSION value. More...
 
void CRequestContext::AddPassThroughProperty (const string &name, const string &value)
 Add pass-through value if it matches a pattern from NCBI_CONTEXT_FIELDS. More...
 
void CRequestContext::SetReadOnly (bool read_only)
 Switch request context to read-only mode. More...
 
bool CRequestContext::GetReadOnly (void) const
 Get current read-only flag. More...
 
TVersion CRequestContext::GetVersion (void) const
 Return version increased on every context change (hit/subhit id, client ip, session id). More...
 
void CRequestContext::SetRequestTracer (const shared_ptr< IRequestTracer > &tracer)
 Set request tracer to be called on context events (start/stop etc.). More...
 
void CRequestContext::SetTracerSpan (const shared_ptr< ITracerSpan > &span)
 
shared_ptr< ITracerSpanCRequestContext::GetTracerSpan (void)
 
 CRequestContext::CRequestContext (const CRequestContext &)
 
CRequestContextCRequestContext::operator= (const CRequestContext &)
 
void CRequestContext::StartRequest (void)
 
void CRequestContext::StopRequest (void)
 
bool CRequestContext::IsRunning (void) const
 
bool CRequestContext::x_IsSetProp (EProperty prop) const
 
void CRequestContext::x_SetProp (EProperty prop)
 
void CRequestContext::x_UnsetProp (EProperty prop)
 
void CRequestContext::x_LogHitID (bool ignore_app_state=false) const
 
void CRequestContext::x_SetHitID (const CSharedHitId &hit_id)
 
string CRequestContext::x_GetHitID (CDiagContext::EDefaultHitIDFlags flag) const
 
void CRequestContext::x_UpdateSubHitID (bool increment, CTempString prefix)
 
static boolCRequestContext::sx_GetDefaultAutoIncRequestIDOnPost (void)
 
bool CRequestContext::x_IsSetPassThroughProp (CTempString name, bool update) const
 
void CRequestContext::x_SetPassThroughProp (CTempString name, CTempString value, bool update) const
 
const stringCRequestContext::x_GetPassThroughProp (CTempString name, bool update) const
 
void CRequestContext::x_ResetPassThroughProp (CTempString name, bool update) const
 
void CRequestContext::x_UpdateStdPassThroughProp (CTempString name) const
 
void CRequestContext::x_UpdateStdContextProp (CTempString name) const
 
static const CMaskCRequestContext::sx_GetContextFieldsMask (void)
 
static string CRequestContext::sx_NormalizeContextPropertyName (const string &name)
 
void CRequestContext::x_LoadEnvContextProperties (void)
 
bool CRequestContext::x_LogHitIDOnError (void) const
 
bool CRequestContext::x_CanModify (void) const
 
void CRequestContext::x_Modify (void)
 
 CRequestContext_PassThrough::CRequestContext_PassThrough (void)
 Get CRequestContext_PassThrough for the current request context. More...
 
 CRequestContext_PassThrough::CRequestContext_PassThrough (CRequestContext ctx)
 Get CRequestContext_PassThrough for the specific request context. More...
 
bool CRequestContext_PassThrough::IsSet (CTempString name) const
 Check if the property is set. More...
 
void CRequestContext_PassThrough::Set (CTempString name, CTempString value)
 Set or update property value. More...
 
const stringCRequestContext_PassThrough::Get (CTempString name) const
 Get current property value or empty string if it's not set;. More...
 
void CRequestContext_PassThrough::Reset (CTempString name)
 Reset property. More...
 
string CRequestContext_PassThrough::Serialize (EFormat format) const
 Serialize current values using the specified format. More...
 
void CRequestContext_PassThrough::Deserialize (CTempString data, EFormat format)
 Deserialize values using the specified format. More...
 
template<class TCallback >
void CRequestContext_PassThrough::Enumerate (TCallback callback)
 Enumerate all properties. More...
 
string CRequestContext_PassThrough::x_SerializeUrlEncoded (void) const
 
void CRequestContext_PassThrough::x_DeserializeUrlEncoded (CTempString data)
 
 CRequestContextGuard_Base::CRequestContextGuard_Base (CRequestContext *context, TFlags flags=0)
 Initialize guard. More...
 
 CRequestContextGuard_Base::~CRequestContextGuard_Base (void)
 Destroy guard. More...
 
void CRequestContextGuard_Base::SetStatus (int status)
 Set request context status. More...
 
void CRequestContextGuard_Base::SetDefaultErrorStatus (int status)
 Set default error status, which will be used if an uncaught exception is detected. More...
 
CRequestContextCRequestContextGuard_Base::GetRequestContext () const
 Get the guarded request context. More...
 
void CRequestContextGuard_Base::Release (void)
 Release the guarded context, restore the saved context if any, do not perform any other actions (logging, setting status). More...
 
virtual const char * CRequestContextException::GetErrCodeString (void) const override
 Translate from the error code value to its string representation. More...
 
 CRequestContextException::NCBI_EXCEPTION_DEFAULT (CRequestContextException, CException)
 
static string CRequestStatus::GetStdStatusMessage (ECode code)
 
 CSysLog::CSysLog (const string &ident=kEmptyStr, TFlags flags=fNoOverride, EFacility default_facility=eDefaultFacility)
 
 CSysLog::CSysLog (const string &ident, TFlags flags, int default_facility)
 
 CSysLog::~CSysLog ()
 
void CSysLog::Post (const SDiagMessage &mess)
 Post message to handler. More...
 
void CSysLog::Post (const string &message, EPriority priority, EFacility facility=eDefaultFacility)
 
void CSysLog::Post (const string &message, EPriority priority, int facility)
 
void CSysLog::HonorRegistrySettings (const IRegistry *reg=0)
 
string CSysLog::GetLogName (void)
 Get current diag posts destination. More...
 
static int CSysLog::x_TranslateFlags (TFlags flags)
 
int CSysLog::x_TranslateFacility (EFacility facility)
 
void CSysLog::x_Connect (void)
 
 CSysLog::DECLARE_CLASS_STATIC_MUTEX (sm_Mutex)
 
TNcbiLog_MTLock NcbiLog_MTLock_Create (void *user_data, FNcbiLog_MTLock_Handler handler)
 Create new MT lock. More...
 
void NcbiLog_MTLock_Delete (TNcbiLog_MTLock lock)
 Call cleanup action on the handler, then destroy it. More...
 
int NcbiLog_Default_MTLock_Handler (void *user_data, ENcbiLog_MTLock_Action action)
 Default implementation of simple MT locking callback. More...
 
void NcbiLog_Init (const char *appname, TNcbiLog_MTLock mt_lock, ENcbiLog_MTLock_Ownership mt_lock_ownership)
 Initializing NcbiLog API. More...
 
void NcbiLog_InitMT (const char *appname)
 Version of NcbiLog_Init with default MT lock implementation. More...
 
void NcbiLog_InitST (const char *appname)
 Version of NcbiLog_Init to use in single-threaded applications. More...
 
void NcbiLog_InitForAttachedContext (const char *appname)
 Version of NcbiLog_Init to use with NcbiLog_Context_* functions only. More...
 
void NcbiLog_InitForAttachedContextST (const char *appname)
 Version of NcbiLog_InitForAttachedContext() intended to use in single-threaded applications. More...
 
void NcbiLog_Destroy (void)
 Destroy NcbiLog API. More...
 
void NcbiLog_Destroy_Thread (void)
 Destroy thread-specific NcbiLog API information. More...
 
void NcbiLog_UpdateOnFork (TNcbiLog_OnForkFlags flags)
 Update logging internal information after fork(). More...
 
const char * NcbiLog_GetHostName (void)
 Get host name. More...
 
const char * NcbiLog_GetHostRole (void)
 Get host role. More...
 
const char * NcbiLog_GetHostLocation (void)
 Get host location. More...
 
ENcbiLog_Destination NcbiLog_SetDestination (ENcbiLog_Destination ds)
 Set up diagnostics destination. More...
 
ENcbiLog_Destination NcbiLog_SetDestinationFile (const char *logfile_base)
 Variant of NcbiLog_SetDestination for logging to a specific file (eNcbiLog_File). More...
 
void NcbiLog_SetSplitLogFile (int value)
 Set split log files flag. More...
 
void NcbiLog_SetProcessId (TNcbiLog_PID pid)
 Set process ID (PID). More...
 
void NcbiLog_SetThreadId (TNcbiLog_TID tid)
 Set thread ID (TID). More...
 
void NcbiLog_SetRequestId (TNcbiLog_Counter rid)
 Set current request ID (RID). More...
 
TNcbiLog_Counter NcbiLog_GetRequestId (void)
 Get current request ID (RID). More...
 
void NcbiLog_SetTime (time_t timer, unsigned long nanoseconds)
 Set the posting date and time. More...
 
void NcbiLog_SetHost (const char *host)
 Set the host name. More...
 
void NcbiLog_AppSetClient (const char *client)
 Set client for the whole application. More...
 
void NcbiLog_SetClient (const char *client)
 Set client for the request. More...
 
void NcbiLog_AppSetSession (const char *session)
 Set session ID (SID) for the whole application. More...
 
char * NcbiLog_AppGetSession (void)
 Get session ID (SID) for the whole application. More...
 
void NcbiLog_AppNewSession (void)
 Auto-generate and then set brand-new application-wide session ID (SID). More...
 
char * NcbiLog_GetSession (void)
 Get sessio ID (SID) for the request. More...
 
void NcbiLog_SetSession (const char *session)
 Set session ID (SID) for the request. More...
 
void NcbiLog_NewSession (void)
 Auto-generate and then set brand-new session ID (SID) for the request. More...
 
void NcbiLog_AppSetHitID (const char *hit_id)
 Set hit ID (HID, a.k.a. More...
 
void NcbiLog_SetHitID (const char *hit_id)
 Set hit ID (HID, a.k.a. More...
 
char * NcbiLog_AppGetHitID (void)
 Get hit ID (HID, a.k.a. More...
 
char * NcbiLog_GetHitID (void)
 Get hit ID (HID, a.k.a. More...
 
char * NcbiLog_GetNextSubHitID_Prefix (const char *prefix)
 Generate a sub-hit ID based on the currently effective (whether it's request-specific or application-wide) hit ID. More...
 
char * NcbiLog_GetNextSubHitID (void)
 
char * NcbiLog_GetCurrentSubHitID_Prefix (const char *prefix)
 Get the last generated sub-hit ID. More...
 
char * NcbiLog_GetCurrentSubHitID (void)
 
void NcbiLog_AppNewHitID (void)
 
void NcbiLog_NewHitID (void)
 
void NcbiLog_FreeMemory (void *ptr)
 Free memory allocated inside the C logging API. More...
 
ENcbiLog_Severity NcbiLog_SetPostLevel (ENcbiLog_Severity sev)
 Set new posting severity threshold. More...
 
TNcbiLog_Context NcbiLog_Context_Create (void)
 Create new thread-specific logging context object. More...
 
int NcbiLog_Context_Attach (TNcbiLog_Context ctx)
 Attach logging context object to the C Logging API. More...
 
void NcbiLog_Context_Detach (void)
 Detach logging context object from the C Logging API. More...
 
void NcbiLog_Context_Destroy (TNcbiLog_Context ctx)
 Destroy context structure. More...
 
ENcbiLog_AppState NcbiLog_GetState (void)
 Get current logging execution state (context and thread specific). More...
 
void NcbiLog_AppStart (const char *argv[])
 Should be called as soon as possible during application initialization. More...
 
void NcbiLog_AppRun (void)
 Should be called after the application is initialized and before its main part. More...
 
void NcbiLog_AppStop (int exit_status)
 Should be called immediately prior to the application exit. More...
 
void NcbiLog_AppStopSignal (int exit_status, int exit_signal)
 The same as NcbiLog_AppStop(), except it also accepts a signal number, if application exited due to a signal. More...
 
void NcbiLog_ReqStart (const SNcbiLog_Param *params)
 Should be called once application startup is complete, before any request processing code is run. More...
 
void NcbiLog_ReqRun (void)
 Should be called once request processing initialization is complete. More...
 
void NcbiLog_ReqStop (int status, size_t bytes_rd, size_t bytes_wr)
 Should be called once request processing is complete. More...
 
void NcbiLog_Extra (const SNcbiLog_Param *params)
 Can be called at any time. More...
 
void NcbiLog_Perf (int status, double timespan, const SNcbiLog_Param *params)
 Can be called at any time. More...
 
void NcbiLog_Trace (const char *msg)
 Writes a message to the <appname>.trace file at level 'TRACE'. More...
 
void NcbiLog_Info (const char *msg)
 Writes a message to the <appname>.trace file at level 'INFO'. More...
 
void NcbiLog_Warning (const char *msg)
 Writes a message to the <appname>.err log at level 'WARNING'. More...
 
void NcbiLog_Error (const char *msg)
 Writes a message to the <appname>.err log at level 'ERROR'. More...
 
void NcbiLog_Critical (const char *msg)
 Writes a message to the <appname>.err log at level 'CRITICAL'. More...
 
void NcbiLog_Fatal (const char *msg)
 Writes a message to the <appname>.err log at level 'FATAL' and then terminate the application. More...
 
void NcbiLog_Note (ENcbiLog_Severity sev, const char *msg)
 Writes a message using "Note[X]" notation for severity. More...
 
template<>
const CNcbiDiagCNcbiDiag::operator<< (const char *const &x) const
 

Variables

shared_ptr< jaegertracing::Span > CJaegerTracerSpan::m_Span
 
const char * CDiagCompileInfo::m_File
 
const char * CDiagCompileInfo::m_Module
 
int CDiagCompileInfo::m_Line
 
const char * CDiagCompileInfo::m_CurrFunctName
 
bool CDiagCompileInfo::m_Parsed
 
bool CDiagCompileInfo::m_ClassSet
 
string CDiagCompileInfo::m_ClassName
 
string CDiagCompileInfo::m_FunctName
 
string CDiagCompileInfo::m_StrFile
 
string CDiagCompileInfo::m_StrModule
 
string CDiagCompileInfo::m_StrCurrFunctName
 
int ErrCode::m_Code
 Major error code number. More...
 
int ErrCode::m_SubCode
 Minor error code number. More...
 
EDiagSev Severity::m_Level
 Severity level. More...
 
TDiagPostFlags SetPostFlags::m_Flags
 flags to set More...
 
const char * MDiagModule::m_Module
 
const char * MDiagClass::m_Class
 
const char * MDiagFunction::m_Function
 
EDiagSev CNcbiDiag::m_Severity
 Severity level of current msg. More...
 
int CNcbiDiag::m_ErrCode
 Error code. More...
 
int CNcbiDiag::m_ErrSubCode
 Error subcode. More...
 
CDiagBuffer & CNcbiDiag::m_Buffer
 This thread's error msg. buffer. More...
 
TDiagPostFlags CNcbiDiag::m_PostFlags
 Bitwise OR of "EDiagPostFlag". More...
 
bool CNcbiDiag::m_OmitStackTrace
 
CDiagCompileInfo CNcbiDiag::m_CompileInfo
 
Uint8 CDiagCollectGuard::m_StartingPoint
 
EDiagSev CDiagCollectGuard::m_PrintSev
 
EDiagSev CDiagCollectGuard::m_CollectSev
 
EDiagSev CDiagCollectGuard::m_SeverityCap
 
EAction CDiagCollectGuard::m_Action
 
EDiagSev SDiagMessage::m_Severity
 Severity level. More...
 
const char * SDiagMessage::m_Buffer
 Not guaranteed to be '\0'-terminated! More...
 
size_t SDiagMessage::m_BufferLen
 Length of m_Buffer. More...
 
const char * SDiagMessage::m_File
 File name. More...
 
const char * SDiagMessage::m_Module
 Module name. More...
 
const char * SDiagMessage::m_Class
 Class name. More...
 
const char * SDiagMessage::m_Function
 Function name. More...
 
size_t SDiagMessage::m_Line
 Line number in file. More...
 
int SDiagMessage::m_ErrCode
 Error code. More...
 
int SDiagMessage::m_ErrSubCode
 Sub Error code. More...
 
TDiagPostFlags SDiagMessage::m_Flags
 Bitwise OR of "EDiagPostFlag". More...
 
const char * SDiagMessage::m_Prefix
 Prefix string. More...
 
const char * SDiagMessage::m_ErrText
 Sometimes 'error' has no numeric code, but can be represented as text. More...
 
TPID SDiagMessage::m_PID
 Process ID. More...
 
TTID SDiagMessage::m_TID
 Thread ID. More...
 
TCount SDiagMessage::m_ProcPost
 Number of the post in the process. More...
 
TCount SDiagMessage::m_ThrPost
 Number of the post in the thread. More...
 
TCount SDiagMessage::m_RequestId
 FastCGI iteration or request ID. More...
 
EEventType SDiagMessage::m_Event
 If the severity is eDPF_AppLog, m_Event contains event type. More...
 
TExtraArgs SDiagMessage::m_ExtraArgs
 If event type is "extra", contains the list of arguments. More...
 
bool SDiagMessage::m_TypedExtra
 Set to true if this is a typed extra message (the arguments include "NCBIEXTRATYPE=<extra-type>"). More...
 
bool SDiagMessage::m_NoTee
 Special flag indicating that the message should not be printed by Tee-handler. More...
 
bool SDiagMessage::m_PrintStackTrace
 
SDiagMessageDataSDiagMessage::m_Data
 
EFormatFlag SDiagMessage::m_Format
 
bool SDiagMessage::m_AllowBadExtraNames
 
SDiagMessage::EEventType CDiagContext_Extra::m_EventType
 
TExtraArgsCDiagContext_Extra::m_Args
 
intCDiagContext_Extra::m_Counter
 
bool CDiagContext_Extra::m_Typed
 
int CDiagContext_Extra::m_PerfStatus
 
double CDiagContext_Extra::m_PerfTime
 
bool CDiagContext_Extra::m_Flushed
 
bool CDiagContext_Extra::m_AllowBadNames
 
static const char * CDiagContext::kProperty_UserName = "user"
 Global properties. More...
 
static const char * CDiagContext::kProperty_HostName = "host"
 
static const char * CDiagContext::kProperty_HostIP = "host_ip_addr"
 
static const char * CDiagContext::kProperty_AppName = "app_name"
 
static const char * CDiagContext::kProperty_ExitSig = "exit_signal"
 
static const char * CDiagContext::kProperty_ExitCode = "exit_code"
 
static const char * CDiagContext::kProperty_AppState = "app_state"
 Per-thread properties. More...
 
static const char * CDiagContext::kProperty_ClientIP = "client_ip"
 
static const char * CDiagContext::kProperty_SessionID = "session_id"
 
static const char * CDiagContext::kProperty_ReqStatus = "request_status"
 
static const char * CDiagContext::kProperty_ReqTime = "request_time"
 
static const char * CDiagContext::kProperty_BytesRd = "bytes_rd"
 
static const char * CDiagContext::kProperty_BytesWr = "bytes_wr"
 
static TPID CDiagContext::sm_PID = 0
 
TUID CDiagContext::m_UID
 
unique_ptr< CEncodedStringCDiagContext::m_Host
 
string CDiagContext::m_HostIP
 
unique_ptr< CEncodedStringCDiagContext::m_Username
 
unique_ptr< CEncodedStringCDiagContext::m_AppName
 
bool CDiagContext::m_AppNameSet
 
unique_ptr< CEncodedStringCDiagContext::m_DefaultSessionId
 
unique_ptr< CSharedHitIdCDiagContext::m_DefaultHitId
 
bool CDiagContext::m_LoggedHitId
 
int CDiagContext::m_ExitCode
 
bool CDiagContext::m_ExitCodeSet
 
int CDiagContext::m_ExitSig
 
EDiagAppState CDiagContext::m_AppState
 
TProperties CDiagContext::m_Properties
 
unique_ptr< CStopWatchCDiagContext::m_StopWatch
 
unique_ptr< TMessagesCDiagContext::m_Messages
 
size_t CDiagContext::m_MaxMessages
 
static CDiagContextCDiagContext::sm_Instance = NULL
 
static bool CDiagContext::sm_ApplogSeverityLocked = false
 
unique_ptr< CRequestRateControlCDiagContext::m_AppLogRC
 
unique_ptr< CRequestRateControlCDiagContext::m_ErrLogRC
 
unique_ptr< CRequestRateControlCDiagContext::m_TraceLogRC
 
atomic< boolCDiagContext::m_AppLogSuspended
 
atomic< boolCDiagContext::m_ErrLogSuspended
 
atomic< boolCDiagContext::m_TraceLogSuspended
 
string CNcbiLogFields::m_Source
 
TFields CNcbiLogFields::m_Fields
 
char CStreamDiagHandler_Base::m_LogName [2048]
 
CNcbiOstreamCStreamDiagHandler::m_Stream
 Diagnostic stream. More...
 
bool CStreamDiagHandler::m_QuickFlush
 Quick flush of stream flag. More...
 
EDiagFileType CFileHandleDiagHandler::m_FileType
 
bool CFileHandleDiagHandler::m_HavePosts
 
bool CFileHandleDiagHandler::m_LowDiskSpace
 
CDiagFileHandleHolderCFileHandleDiagHandler::m_Handle
 
CSpinLockCFileHandleDiagHandler::m_HandleLock
 
CStopWatchCFileHandleDiagHandler::m_ReopenTimer
 
unique_ptr< TMessagesCFileHandleDiagHandler::m_Messages
 
CStreamDiagHandler_BaseCFileDiagHandler::m_Err
 
bool CFileDiagHandler::m_OwnErr
 
CStreamDiagHandler_BaseCFileDiagHandler::m_Log
 
bool CFileDiagHandler::m_OwnLog
 
CStreamDiagHandler_BaseCFileDiagHandler::m_Trace
 
bool CFileDiagHandler::m_OwnTrace
 
CStreamDiagHandler_BaseCFileDiagHandler::m_Perf
 
bool CFileDiagHandler::m_OwnPerf
 
CStopWatchCFileDiagHandler::m_ReopenTimer
 
CAsyncDiagThreadCAsyncDiagHandler::m_AsyncThread
 Thread handling all physical printing of log messages. More...
 
string CAsyncDiagHandler::m_ThreadSuffix
 
string CDiagRestorer::m_PostPrefix
 Message prefix. More...
 
list< stringCDiagRestorer::m_PrefixList
 List of prefixes. More...
 
TDiagPostFlags CDiagRestorer::m_PostFlags
 Post flags. More...
 
EDiagSev CDiagRestorer::m_PostSeverity
 Post severity. More...
 
EDiagSevChange CDiagRestorer::m_PostSeverityChange
 Severity change. More...
 
bool CDiagRestorer::m_IgnoreToDie
 Ignore to die on die sev. More...
 
EDiagSev CDiagRestorer::m_DieSeverity
 Die level severity. More...
 
EDiagTrace CDiagRestorer::m_TraceDefault
 Default trace setting. More...
 
bool CDiagRestorer::m_TraceEnabled
 Trace enabled? More...
 
CDiagHandlerCDiagRestorer::m_Handler
 Class handler. More...
 
bool CDiagRestorer::m_CanDeleteHandler
 Can handler be deleted? More...
 
CDiagErrCodeInfoCDiagRestorer::m_ErrCodeInfo
 Error code information. More...
 
bool CDiagRestorer::m_CanDeleteErrCodeInfo
 Can delete err code info? More...
 
bool CDiagRestorer::m_ApplogSeverityLocked
 Limiting applog post level? More...
 
string SDiagErrCodeDescription::m_Message
 Error message (short) More...
 
string SDiagErrCodeDescription::m_Explanation
 Error message (with detailed explanation) More...
 
int SDiagErrCodeDescription::m_Severity
 Message severity (if less that 0, then use current diagnostic severity level) More...
 
TInfo CDiagErrCodeInfo::m_Info
 Map storing error codes and descriptions. More...
 
CStopWatchCPerfLogger::m_StopWatch
 
CStopWatch::EStart CPerfLogger::m_TimerState
 
bool CPerfLogger::m_IsDiscarded
 
double CPerfLogger::m_Adjustment
 
double CPerfLogger::m_Elapsed
 
CTime CPerfLogger::m_FirstStartTime
 
CTime CPerfLogger::m_LastStartTime
 
CPerfLogger CPerfLogGuard::m_Logger
 
string CPerfLogGuard::m_Resource
 
SDiagMessage::TExtraArgs CPerfLogGuard::m_Parameters
 
string CSharedHitId::m_HitId
 
TSubHitId CSharedHitId::m_SubHitId
 
CRef< TSharedCounterCSharedHitId::m_SharedSubHitId
 
EDiagAppState CSharedHitId::m_AppState
 
TCount CRequestContext::m_RequestID
 
EDiagAppState CRequestContext::m_AppState
 
string CRequestContext::m_ClientIP
 
CEncodedString CRequestContext::m_SessionID
 
CSharedHitId CRequestContext::m_HitID
 
string CRequestContext::m_Dtab
 
int CRequestContext::m_HitIDLoggedFlag
 
int CRequestContext::m_ReqStatus
 
CStopWatch CRequestContext::m_ReqTimer
 
Int8 CRequestContext::m_BytesRd
 
Int8 CRequestContext::m_BytesWr
 
TProperties CRequestContext::m_Properties
 
TPropSet CRequestContext::m_PropSet
 
bool CRequestContext::m_IsRunning
 
bool CRequestContext::m_AutoIncOnPost
 
TContextFlags CRequestContext::m_Flags
 
string CRequestContext::m_SubHitIDCache
 
Uint8 CRequestContext::m_OwnerTID
 
bool CRequestContext::m_IsReadOnly
 
TVersion CRequestContext::m_Version
 
TPassThroughProperties CRequestContext::m_PassThroughProperties
 
shared_ptr< IRequestTracerCRequestContext::m_Tracer
 
shared_ptr< ITracerSpanCRequestContext::m_TracerSpan
 
static unique_ptr< CMaskFileNameCRequestContext::sm_ContextFields
 
static unique_ptr< TPassThroughPropertiesCRequestContext::sm_EnvContextProperties
 
static CAtomicCounter CRequestContext::sm_VersionCounter
 
CRef< CRequestContextCRequestContext_PassThrough::m_Context
 
TFlags CRequestContextGuard_Base::m_Flags = 0
 
int CRequestContextGuard_Base::m_ErrorStatus = 500
 
CRef< CRequestContextCRequestContextGuard_Base::m_SavedContext
 
CRef< CRequestContextCRequestContextGuard_Base::m_RequestContext
 
bool CRequestContextGuard_Base::m_OriginatesFromThrow = false
 
static const char * CSysLog::kLogName_Syslog = "SYSLOG"
 
static CSysLogCSysLog::sm_Current = NULL
 
string CSysLog::m_Ident
 
TFlags CSysLog::m_Flags
 
int CSysLog::m_DefaultFacility
 
const char * SNcbiLog_Param::key
 
const char * SNcbiLog_Param::value
 

Friends

class CDiagCompileInfo::CNcbiDiag
 
class SDiagMessage::CDiagContext
 
class SDiagMessage::CDiagContext_Extra
 
class CDiagContext_Extra::CDiagContext
 
class CDiagContext::CDiagContext_Extra
 
class CDiagContext::CDiagContextThreadData
 
class CDiagContext::CDiagBuffer
 
class CDiagContext::CRequestContext
 
class CPerfLogger::CPerfLogGuard
 
class CRequestContext::CDiagContext
 
class CRequestContext::CDiagBuffer
 
class CRequestContext::CDiagContextThreadData
 
class CRequestContext::CRequestContext_PassThrough
 
const CNcbiDiagMDiagModule::operator<< (const CNcbiDiag &diag, const MDiagModule &module)
 
const CNcbiDiagMDiagClass::operator<< (const CNcbiDiag &diag, const MDiagClass &nclass)
 
const CNcbiDiagMDiagFunction::operator<< (const CNcbiDiag &diag, const MDiagFunction &function)
 
const CNcbiDiagCNcbiDiag::Reset (const CNcbiDiag &diag)
 Reset the content of current message. More...
 
const CNcbiDiagCNcbiDiag::Endm (const CNcbiDiag &diag)
 Flush current message, start new one. More...
 
const CNcbiDiagCNcbiDiag::Info (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to INFO. More...
 
const CNcbiDiagCNcbiDiag::Warning (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to WARNING. More...
 
const CNcbiDiagCNcbiDiag::Error (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to ERROR. More...
 
const CNcbiDiagCNcbiDiag::Critical (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to CRITICAL ERROR. More...
 
const CNcbiDiagCNcbiDiag::Fatal (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to FATAL. More...
 
const CNcbiDiagCNcbiDiag::Trace (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to TRACE. More...
 
const CNcbiDiagCNcbiDiag::Message (const CNcbiDiag &diag)
 Set IsMessage flag to indicate that the current post is a message. More...
 
const CNcbiDiagCNcbiDiag::Note (const CNcbiDiag &diag)
 Set IsNote flag to indicate that the current post is a note. More...
 
const CNcbiDiagCNcbiDiag::Console (const CNcbiDiag &diag)
 Set IsConsole flag to indicate that the current post should go to console regardless of its severity (in addition to the default output – file etc.). More...
 
const CNcbiDiagCNcbiDiag::StackTrace (const CNcbiDiag &diag)
 Print stack trace. More...
 
CDiagContext_Extra CDiagContext_Extra::g_PostPerf (int status, double timespan, SDiagMessage::TExtraArgs &args)
 

Detailed Description

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

Definition at line 120 of file ncbi_c_log.h.

◆ DIAG_COMPILE_INFO

#define DIAG_COMPILE_INFO
Value:
NCBI_NS_NCBI::CDiagCompileInfo(__FILE__, \
__LINE__, \
#define NCBI_MODULE
#define NCBI_MAKE_MODULE(module)
Set default module name based on NCBI_MODULE macro.
Definition: ncbidiag.hpp:149
#define NCBI_CURRENT_FUNCTION
Get current function name.
Definition: ncbidiag.hpp:142

Make compile time diagnostic information object to use in CNcbiDiag and CException.

This macro along with functionality of macro NCBI_MAKE_MODULE and of constructor CDiagCompileInfo ensures that if variable NCBI_MODULE will be defined then its value will be used as module name, but if it isn't defined then module name in CDiagCompileInfo will be empty. "Checking" of definition of NCBI_MODULE is performed at the moment of macro issuing so you can define and redefine NCBI_MODULE several times during one cpp-file. But BE WARNED that macro NCBI_MODULE is considered as not defined when used in any header file. So if you want for example make some error posting from inline function defined in hpp-file and want your custom module name to be shown in error message then you have to use MDiagModule manipulator as following:

ERR_POST_X(1, MDiagModule("MY_MODULE_NAME") << "Error message" );

See also
CDiagCompileInfo

Definition at line 170 of file ncbidiag.hpp.

◆ DIAG_MESSAGE_FILE

#define DIAG_MESSAGE_FILE   "MessageFile"

Diagnostic message file.

Definition at line 3092 of file ncbidiag.hpp.

◆ DIAG_POST_LEVEL

#define DIAG_POST_LEVEL   "DIAG_POST_LEVEL"

Diagnostic post severity level.

The value of DIAG_POST_LEVEL can be a digital value (0-9) or string value from CDiagBuffer::sm_SeverityName[].

Definition at line 1447 of file ncbidiag.hpp.

◆ DIAG_TRACE

#define DIAG_TRACE   "DIAG_TRACE"

Diagnostic trace setting.

Definition at line 1540 of file ncbidiag.hpp.

◆ ERR_FATAL

#define ERR_FATAL (   message)
Value:
NCBI_NS_NCBI::EndmFatal(NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO, \
NCBI_NS_NCBI::eDiag_Fatal).GetRef() << message )
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
Definition: ncbidiag.hpp:170
@ eDiag_Fatal
Fatal error – guarantees exit(or abort)
Definition: ncbidiag.hpp:655
void EndmFatal(const CNcbiDiag &diag)
Definition: ncbidiag.cpp:8360

Posting fatal error and abort.

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro ERR_FATAL_X to make possible more flexible error statistics and logging.

See also
ERR_FATAL_X, ERR_POST

Definition at line 240 of file ncbidiag.hpp.

◆ ERR_FATAL_EX

#define ERR_FATAL_EX (   err_code,
  err_subcode,
  message 
)
Value:
NCBI_NS_NCBI::EndmFatal(NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO, \
NCBI_NS_NCBI::ErrCode( (err_code), (err_subcode) ) << message )
#define ErrCode()
Get the error code for the last failed system function.
Definition: mdb.c:377

Definition at line 266 of file ncbidiag.hpp.

◆ ERR_FATAL_X

#define ERR_FATAL_X (   err_subcode,
  message 
)     ERR_FATAL_XX(NCBI_USE_ERRCODE_X, err_subcode, message)

Definition at line 556 of file ncbidiag.hpp.

◆ ERR_FATAL_XX

#define ERR_FATAL_XX (   error_name,
  err_subcode,
  message 
)
Value:
NCBI_ERR_SUBCODE_X_NAME(error_name, err_subcode), \
message)
#define NCBI_ERRCODE_X_NAME(name)
Returns value of error code by its name defined by NCBI_DEFINE_ERRCODE_X.
Definition: ncbidiag.hpp:369
#define ERR_FATAL_EX(err_code, err_subcode, message)
Definition: ncbidiag.hpp:266
#define NCBI_ERR_SUBCODE_X_NAME(name, subcode)
Pass subcode as argument with check of its validity for given error code.
Definition: ncbidiag.hpp:468

Definition at line 574 of file ncbidiag.hpp.

◆ ERR_POST

#define ERR_POST (   message)
Value:
( NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO).GetRef() \
<< message \
<< NCBI_NS_NCBI::Endm )

Error posting with file, line number information but without error codes.

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro ERR_POST_X to make possible more flexible error statistics and logging.

See also
ERR_POST_EX, ERR_POST_X
Examples
/home/coremake/doxygen/cxx/include/corelib/ncbimisc.hpp.

Definition at line 186 of file ncbidiag.hpp.

◆ ERR_POST_EX

#define ERR_POST_EX (   err_code,
  err_subcode,
  message 
)
Value:
( NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO).GetRef() \
<< NCBI_NS_NCBI::ErrCode( (err_code), (err_subcode) ) \
<< message \
<< NCBI_NS_NCBI::Endm )

Error posting with error codes.

This macro should be used only when you need to make non-constant error subcode. In all other cases it's strongly recomended to move in all projects (except tests) to macro ERR_POST_X to make possible more flexible error statistics and logging.

See also
ERR_POST, ERR_POST_X

Definition at line 252 of file ncbidiag.hpp.

◆ ERR_POST_N_TIMES

#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.

Definition at line 594 of file ncbidiag.hpp.

◆ ERR_POST_ONCE

#define ERR_POST_ONCE (   message)    ERR_POST_N_TIMES(1, message)

Error posting only once during program execution.

Definition at line 602 of file ncbidiag.hpp.

◆ ERR_POST_X

#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.

Also checks subcode correctness. When error subcode is incorrect (greater than defined in NCBI_DEFINE_ERRCODE_X) compile-time error is issued. All calls to ERR_POST_X under the same default error code MUST be with deferent error subcodes to make possible more flexible error statistics and logging. If using the macro leads to compile errors containing strings like "err_code_x" or "ErrCodeX" in messages, it means you didn't define error code name with NCBI_DEFINE_ERRCODE_X macro or didn't select current default error code with valid NCBI_USE_ERRCODE_X definition. This macro allows the use of only constant error subcodes (integer literals or enum constants). If you need to make variable error subcode you need to use macro ERR_POST_EX as follows:

NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 5); ... #define NCBI_USE_ERRCODE_X Corelib_Util ... ERR_POST_EX(NCBI_ERRCODE_X, my_subcode, "My error message with variables " << var);

Or in more complicated way:

NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 5); ... // no need to define NCBI_USE_ERRCODE_X ... ERR_POST_EX(NCBI_ERRCODE_X_NAME(Corelib_Util), my_subcode, "My error message with variables " << var);

It's strongly recommended to use macro NCBI_CHECK_ERR_SUBCODE_X (or NCBI_CHECK_ERR_SUBCODE_X_NAME in complicated case) to check validity of error subcodes in places where variable 'my_subcode' is assigned.

See also
NCBI_DEFINE_ERRCODE_X, NCBI_ERRCODE_X, ERR_POST_EX

Definition at line 550 of file ncbidiag.hpp.

◆ ERR_POST_X_N_TIMES

#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.

See also
NCBI_DEFINE_ERRCODE_X, NCBI_ERRCODE_X, ERR_POST_X

Definition at line 611 of file ncbidiag.hpp.

◆ ERR_POST_X_ONCE

#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.

See also
NCBI_DEFINE_ERRCODE_X, NCBI_ERRCODE_X, ERR_POST_X

Definition at line 621 of file ncbidiag.hpp.

◆ ERR_POST_XX

#define ERR_POST_XX (   error_name,
  err_subcode,
  message 
)
Value:
NCBI_ERR_SUBCODE_X_NAME(error_name, err_subcode), \
message)
#define ERR_POST_EX(err_code, err_subcode, message)
Error posting with error codes.
Definition: ncbidiag.hpp:252

Error posting with error code having given name and with given error subcode.

Macro must be placed in headers instead of ERR_POST_X to not confuse default error codes used in sources where this header is included.

See also
NCBI_DEFINE_ERRCODE_X, ERR_POST_X

Definition at line 564 of file ncbidiag.hpp.

◆ ERR_POST_XX_N_TIMES

#define ERR_POST_XX_N_TIMES (   count,
  error_name,
  err_subcode,
  message 
)
Value:
(error_name, err_subcode, message) )
#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.
Definition: ncbidiag.hpp:582
#define ERR_POST_XX(error_name, err_subcode, message)
Error posting with error code having given name and with given error subcode.
Definition: ncbidiag.hpp:564

Error posting only given number of times during program execution with given error code name and given error subcode.

See also
NCBI_DEFINE_ERRCODE_X, ERR_POST_XX

Definition at line 631 of file ncbidiag.hpp.

◆ ERR_POST_XX_ONCE

#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.

See also
NCBI_DEFINE_ERRCODE_X, NCBI_ERRCODE_X, ERR_POST_XX

Definition at line 643 of file ncbidiag.hpp.

◆ INFO_POST

#define INFO_POST (   message)    SEVERITY_POST(Info, message)

Definition at line 201 of file ncbidiag.hpp.

◆ INFO_POST_EX

#define INFO_POST_EX (   errcode,
  message 
)    SEVERITY_POST_EX(Info, errcode, subcode, message)

Definition at line 215 of file ncbidiag.hpp.

◆ INFO_POST_X

#define INFO_POST_X (   subcode,
  message 
)    SEVERITY_POST_X(Info, subcode, message)

Definition at line 208 of file ncbidiag.hpp.

◆ LOG_POST

#define LOG_POST (   message)
Value:
( NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO, \
<< message \
<< NCBI_NS_NCBI::Endm )
@ eDPF_IsNote
Print "Note[X]" severity name.
Definition: ncbidiag.hpp:757
@ eDPF_Log
Print the posted message only; without severity, location, prefix, etc.
Definition: ncbidiag.hpp:747
@ eDiag_Error
Error message.
Definition: ncbidiag.hpp:653

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro LOG_POST_X to make possible more flexible error statistics and logging.

See also
LOG_POST_EX, LOG_POST_X

Definition at line 226 of file ncbidiag.hpp.

◆ LOG_POST_EX

#define LOG_POST_EX (   err_code,
  err_subcode,
  message 
)
Value:
( NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO, \
<< NCBI_NS_NCBI::ErrCode( (err_code), (err_subcode) ) \
<< message \
<< NCBI_NS_NCBI::Endm )

Definition at line 258 of file ncbidiag.hpp.

◆ LOG_POST_N_TIMES

#define LOG_POST_N_TIMES (   count,
  message 
)     NCBI_REPEAT_POST_N_TIMES( LOG_POST, count, (message) )

Definition at line 597 of file ncbidiag.hpp.

◆ LOG_POST_ONCE

#define LOG_POST_ONCE (   message)    LOG_POST_N_TIMES(1, message)

Definition at line 604 of file ncbidiag.hpp.

◆ LOG_POST_X

#define LOG_POST_X (   err_subcode,
  message 
)     LOG_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message)

Definition at line 553 of file ncbidiag.hpp.

◆ LOG_POST_X_N_TIMES

#define LOG_POST_X_N_TIMES (   count,
  err_subcode,
  message 
)     NCBI_REPEAT_POST_N_TIMES( LOG_POST_X, count, (err_subcode, message) )

Definition at line 614 of file ncbidiag.hpp.

◆ LOG_POST_X_ONCE

#define LOG_POST_X_ONCE (   err_subcode,
  message 
)     LOG_POST_X_N_TIMES(1, err_subcode, message)

Definition at line 624 of file ncbidiag.hpp.

◆ LOG_POST_XX

#define LOG_POST_XX (   error_name,
  err_subcode,
  message 
)
Value:
NCBI_ERR_SUBCODE_X_NAME(error_name, err_subcode), \
message)
#define LOG_POST_EX(err_code, err_subcode, message)
Definition: ncbidiag.hpp:258

Definition at line 569 of file ncbidiag.hpp.

◆ LOG_POST_XX_N_TIMES

#define LOG_POST_XX_N_TIMES (   count,
  error_name,
  err_subcode,
  message 
)
Value:
(error_name, err_subcode, message) )
#define LOG_POST_XX(error_name, err_subcode, message)
Definition: ncbidiag.hpp:569

Definition at line 635 of file ncbidiag.hpp.

◆ LOG_POST_XX_ONCE

#define LOG_POST_XX_ONCE (   error_name,
  err_subcode,
  message 
)     LOG_POST_XX_N_TIMES(1, error_name, err_subcode, message)

Definition at line 646 of file ncbidiag.hpp.

◆ NCBI_CHECK_ERR_SUBCODE_X

#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.

Definition at line 464 of file ncbidiag.hpp.

◆ NCBI_CHECK_ERR_SUBCODE_X_NAME

#define NCBI_CHECK_ERR_SUBCODE_X_NAME (   name,
  subcode 
)
Value:
(int)sizeof(NCBI_NS_NCBI::WRONG_ERROR_SUBCODE_IN_POST_MACRO< \
NCBI_ERRCODE_X_NAME(name), subcode, \
((unsigned int)subcode > \
(unsigned int)NCBI_MAX_ERR_SUBCODE_X_NAME(name)) \
>) \
)
void CheckErrSubcodeX(int)
Additional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro.
Definition: ncbidiag.hpp:442
#define NCBI_MAX_ERR_SUBCODE_X_NAME(name)
Returns maximum value of error subcode within error code with given name.
Definition: ncbidiag.hpp:381

Issue compile-time error if error subcode given is not valid for given error code name.

This design is used for all compilers except early versions of gcc. Though for MIPSpro and ICC it's not enough to make error message clear (see addition below).

See also
ERR_POST_X

Definition at line 452 of file ncbidiag.hpp.

◆ NCBI_CHECK_ERRCODE_USAGE

#define NCBI_CHECK_ERRCODE_USAGE (   name)
Value:
inline void NCBI_NAME2(s_ErrCodeCheck_, name) ( \
NCBI_NS_NCBI::WRONG_USAGE_OF_DEFINE_ERR_SUBCODE_MACRO < \
NCBI_ERRCODE_X_NAME(name), \
NCBI_NS_NCBI::err_code_x::eErrCodeX_Max_##name != 0> \
/*err_subcode*/) \
{}
#define NCBI_NAME2(Name1, Name2)
Name concatenation macro with two names.
Definition: ncbistl.hpp:122

Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code.

Definition at line 432 of file ncbidiag.hpp.

◆ NCBI_CURRENT_FUNCTION

#define NCBI_CURRENT_FUNCTION   NCBI_NS_NCBI::g_DiagUnknownFunction()

Get current function name.

Defined inside of either a method or a function body only.

Definition at line 142 of file ncbidiag.hpp.

◆ NCBI_DEFINE_ERR_SUBCODE_X

#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.

Currently used error code is defined by macro NCBI_USE_ERRCODE_X. This macro is a simplified version of NCBI_DEFINE_ERR_SUBCODE_XX and can be handy to use when some error code is used only in one source file and no other error code is used in the same source file. To use this macro you must put 0 as max_err_subcode in NCBI_DEFINE_ERRCODE_X macro. Otherwise compilation error will occur. Macro MUST be used inside ncbi scope.

Example: NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 0); ... #define NCBI_USE_ERRCODE_X Corelib_Util NCBI_DEFINE_ERR_SUBCODE_X(5); ... ERR_POST_X(3, "My error message with variables " << var);

See also
NCBI_DEFINE_ERRCODE_X, NCBI_DEFINE_ERR_SUBCODE_XX

Definition at line 333 of file ncbidiag.hpp.

◆ NCBI_DEFINE_ERR_SUBCODE_XX

#define NCBI_DEFINE_ERR_SUBCODE_XX (   name,
  max_err_subcode 
)
Value:
namespace err_code_x { \
template <> \
struct NCBI_NAME2(SErrCodeX_Max_, name)<true> { \
enum { \
value = max_err_subcode \
}; \
}; \
}
#define NCBI_CHECK_ERRCODE_USAGE(name)
Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code.
Definition: ncbidiag.hpp:432

Define maximum value of subcode for particular error code name.

To use this macro you must put 0 as max_err_subcode in NCBI_DEFINE_ERRCODE_X macro. Otherwise compilation error will occur. Macro can be used only once per compilation unit. Macro MUST be used inside ncbi scope.

Example: NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 0); ... NCBI_DEFINE_ERR_SUBCODE_XX(Corelib_Util, 5); ... #define NCBI_USE_ERRCODE_X Corelib_Util ... ERR_POST_X(3, "My error message with variables " << var);

See also
NCBI_DEFINE_ERRCODE_X

Definition at line 354 of file ncbidiag.hpp.

◆ NCBI_DEFINE_ERRCODE_X

#define NCBI_DEFINE_ERRCODE_X (   name,
  err_code,
  max_err_subcode 
)
Value:
namespace err_code_x { \
enum { \
eErrCodeX_##name = err_code, \
eErrCodeX_Max_##name = max_err_subcode \
}; \
template <bool dummy> \
struct SErrCodeX_Max_##name { \
enum { \
value = max_err_subcode, \
dumm_dumm = int(dummy) \
}; \
}; \
} \
NCBI_EAT_SEMICOLON(err_code)
static CBioSource dummy
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210

Define global error code name with given value (err_code) and given maximum value of error subcode within this code.

To use defined error code you need to define symbol NCBI_USE_ERRCODE_X with name as its value. This error code is used only in ERR_POST_X macro. Maximum value of error subcode is being checked during compilation and exists for developers to know what code they can use in next inserted ERR_POST_X call (i.e. when one want to insert new ERR_POST_X call he has to find definition of error code used in the source file, increase value of maximum subcode and put result in ERR_POST_X call). Definition of error code and its maximum subcode can be split into 2 independent macros to avoid recompilation of everything that includes header with error code definition. For more information about it see NCBI_DEFINE_ERR_SUBCODE_X. Macro MUST be used inside ncbi scope.

Example: NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 5); ... #define NCBI_USE_ERRCODE_X Corelib_Util ... ERR_POST_X(3, "My error message with variables " << var);

See also
NCBI_DEFINE_ERR_SUBCODE_X, ERR_POST_X, NCBI_ERRCODE_X, NCBI_MAX_ERR_SUBCODE_X

Definition at line 297 of file ncbidiag.hpp.

◆ NCBI_ERR_SUBCODE_X

#define NCBI_ERR_SUBCODE_X (   subcode)     (NCBI_CHECK_ERR_SUBCODE_X(subcode), subcode)

Pass subcode as argument with check of its validity for current error code.

Definition at line 472 of file ncbidiag.hpp.

◆ NCBI_ERR_SUBCODE_X_NAME

#define NCBI_ERR_SUBCODE_X_NAME (   name,
  subcode 
)     (NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode), subcode)

Pass subcode as argument with check of its validity for given error code.

Definition at line 468 of file ncbidiag.hpp.

◆ NCBI_ERRCODE_X

#define NCBI_ERRCODE_X   NCBI_ERRCODE_X_NAME(NCBI_USE_ERRCODE_X)

Returns currently set default error code.

Default error code is set by definition of NCBI_USE_ERRCODE_X with name of error code as its value.

See also
NCBI_DEFINE_ERRCODE_X

Definition at line 376 of file ncbidiag.hpp.

◆ NCBI_ERRCODE_X_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.

See also
NCBI_DEFINE_ERRCODE_X

Definition at line 369 of file ncbidiag.hpp.

◆ NCBI_MAKE_MODULE

#define NCBI_MAKE_MODULE (   module)    NCBI_AS_STRING(module)

Set default module name based on NCBI_MODULE macro.

See also
DIAG_COMPILE_INFO

Definition at line 149 of file ncbidiag.hpp.

◆ NCBI_MAX_ERR_SUBCODE_X

#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.

See also
NCBI_DEFINE_ERRCODE_X

Definition at line 387 of file ncbidiag.hpp.

◆ NCBI_MAX_ERR_SUBCODE_X_NAME

#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.

See also
NCBI_DEFINE_ERRCODE_X

Definition at line 381 of file ncbidiag.hpp.

◆ NCBI_REPEAT_POST_N_TIMES

#define NCBI_REPEAT_POST_N_TIMES (   post_macro,
  count,
  params 
)
Value:
do { \
static atomic<int> sx_to_show(count); \
int to_show = sx_to_show; \
if ( to_show > 0 ) { \
sx_to_show = to_show - 1; \
post_macro params; /* parenthesis are in params */ \
} \
} while ( false )

Common code for making log or error posting only given number of times during program execution.

This macro MUST not be used outside this header.

Definition at line 582 of file ncbidiag.hpp.

◆ NCBILOG_INT8_FORMAT_SPEC

#define NCBILOG_INT8_FORMAT_SPEC   "I64"

Definition at line 291 of file ncbi_c_log.h.

◆ NCBILOG_UINT8_FORMAT_SPEC

#define NCBILOG_UINT8_FORMAT_SPEC   "I64u"

Definition at line 292 of file ncbi_c_log.h.

◆ PERF_POST

#define PERF_POST (   perf_logger,
  status,
  resource,
  args 
)
Value:
do { if ( CPerfLogger::IsON() ) \
perf_logger.Post(CRequestStatus::status, resource) args; \
} while (false)
static bool IsON(void)
Is performance logging on, globally? Controlled by CParam(section="Log", entry="PerfLogging",...
Definition: perf_log.cpp:58

Convenience macro that also saves cycles when the performance logging is globally turned off.

Usage example:
This example demonstrates logging a variety of performance statistics.
CPerfLogger perf_logger;
PERF_POST(perf_logger, e200_Ok, "ApacheSlotStats",
.Print("total_slots",
.Print("free_slots",
NStr::NumericToString(total ? total - used : 0))
.Print("used_slots",
NStr::NumericToString(total ? used : 0))
.Print("used_slots_pct",
NStr::NumericToString(total ? 100 * used / total : 0))
.Print("ratio",
.Print("penalty", m_Mode == eShmem ? "N/A" :
NStr::DoubleToString(m_Penalty, 0))
.Print("error",
CPerfLogger –.
Definition: perf_log.hpp:80
void Print(const CCompactSAMApplication::AlignInfo &ai)
#define PERF_POST(perf_logger, status, resource, args)
Convenience macro that also saves cycles when the performance logging is globally turned off.
Definition: perf_log.hpp:213
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
Definition: ncbistr.hpp:5187
static const string BoolToString(bool value)
Convert bool to string.
Definition: ncbistr.cpp:2815
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
Note
The status must come from enum CRequestStatus::ECode (but without the class scope, which is added by the macro).

Definition at line 213 of file perf_log.hpp.

◆ PERF_POST_DB

#define PERF_POST_DB (   perf_logger,
  status,
  resource,
  server,
  args 
)
Value:
do { if ( CPerfLogger::IsON() ) \
perf_logger.Post(CRequestStatus::status, resource) \
.Print("dbserver", server) args; \
} while (false)

Adaptation for logging database performance.

Usage example:
This example demonstrates logging the results of a stored procedure call.
CPerfLogger perf_logger;
PERF_POST_DB(perf_logger, e200_Ok,
"StoredProc123", "MSSQL444")
.Print("foo", "bar"));
#define PERF_POST_DB(perf_logger, status, resource, server, args)
Adaptation for logging database performance.
Definition: perf_log.hpp:232
Note
The status must come from enum CRequestStatus::ECode (but without the class scope, which is added by the macro).

Definition at line 232 of file perf_log.hpp.

◆ SEVERITY_POST

#define SEVERITY_POST (   severity,
  message 
)
Value:
do if (NCBI_NS_NCBI::IsVisibleDiagPostLevel(NCBI_NS_NCBI::eDiag_##severity)) \
ERR_POST(severity << message); \
while(0)
bool IsVisibleDiagPostLevel(EDiagSev sev)
Check if the specified severity is higher or equal to the currently selected post level and will be p...
Definition: ncbidiag.cpp:6166

Wrappers for ERR_POST family of macros checking if the desired severity is enabled.

See also
ERR_POST, ERR_POST_X, ERR_POST_EX

Definition at line 196 of file ncbidiag.hpp.

◆ SEVERITY_POST_EX

#define SEVERITY_POST_EX (   severity,
  errcode,
  subcode,
  message 
)
Value:
do if (NCBI_NS_NCBI::IsVisibleDiagPostLevel(NCBI_NS_NCBI::eDiag_##severity)) \
ERR_POST_EX(errcode, subcode, severity << message); \
while(0)

Definition at line 210 of file ncbidiag.hpp.

◆ SEVERITY_POST_X

#define SEVERITY_POST_X (   severity,
  subcode,
  message 
)
Value:
do if (NCBI_NS_NCBI::IsVisibleDiagPostLevel(NCBI_NS_NCBI::eDiag_##severity)) \
ERR_POST_X(subcode, severity << message); \
while(0)

Definition at line 203 of file ncbidiag.hpp.

◆ TRACE_POST

#define TRACE_POST (   message)    SEVERITY_POST(Trace, message)

Definition at line 202 of file ncbidiag.hpp.

◆ TRACE_POST_EX

#define TRACE_POST_EX (   errcode,
  message 
)    SEVERITY_POST_EX(Trace, errcode, subcode, message)

Definition at line 216 of file ncbidiag.hpp.

◆ TRACE_POST_X

#define TRACE_POST_X (   subcode,
  message 
)    SEVERITY_POST_X(Trace, subcode, message)

Definition at line 209 of file ncbidiag.hpp.

◆ WARNING_POST

#define WARNING_POST (   message)    SEVERITY_POST(Warning, message)

Definition at line 200 of file ncbidiag.hpp.

◆ WARNING_POST_EX

#define WARNING_POST_EX (   errcode,
  subcode,
  message 
)    SEVERITY_POST_EX(Warning, errcode, subcode, message)

Definition at line 214 of file ncbidiag.hpp.

◆ WARNING_POST_X

#define WARNING_POST_X (   subcode,
  message 
)    SEVERITY_POST_X(Warning, subcode, message)

Definition at line 207 of file ncbidiag.hpp.

Typedef Documentation

◆ CSysLogDiagHandler

Definition at line 126 of file syslog.hpp.

◆ FAbortHandler

typedef void(* FAbortHandler) (void)

Abort handler function type.

Definition at line 1524 of file ncbidiag.hpp.

◆ FDiagCleanup

typedef void(* FDiagCleanup) (void *data)

Diagnostic cleanup function type.

Definition at line 2488 of file ncbidiag.hpp.

◆ FDiagHandler

typedef void(* FDiagHandler) (const SDiagMessage &mess)

Diagnostic handler function type.

Definition at line 2485 of file ncbidiag.hpp.

◆ FIosbaseManip

typedef IOS_BASE&(* CNcbiDiag::FIosbaseManip) (IOS_BASE &)

Definition at line 955 of file ncbidiag.hpp.

◆ FIosManip

typedef CNcbiIos&(* CNcbiDiag::FIosManip) (CNcbiIos &)

Definition at line 956 of file ncbidiag.hpp.

◆ FManip

typedef const CNcbiDiag&(* CNcbiDiag::FManip) (const CNcbiDiag &)

Diagnostic stream manipulator.

See also
Reset(), Endm()
Info(), Warning(), Error(), Critical(), Fatal(), Trace()

Definition at line 954 of file ncbidiag.hpp.

◆ FNcbiLog_MTLock_Handler

typedef int(* FNcbiLog_MTLock_Handler) (void *user_data, ENcbiLog_MTLock_Action action)

MT locking callback.

Parameters
user_dataUnspecified data to call "handler" with. Could be used to have the same handler for some different MT locks. The 'user_data' allow to distinguish each lock and adjust behavior accordingly.
actionOperation that should be done in the callback handler.
Returns
Non-zero value if the requested operation was successful.
Note
The "-1" value is reserved for unset handler; you also may want to return "-1" if your locking function does no locking, and you don't consider it as an error, but still want the caller to be ware of this "rightful non-doing" as opposed to the "rightful doing".
See also
NcbiLog_MTLock_Create, NcbiLog_MTLock_Delete

Definition at line 186 of file ncbi_c_log.h.

◆ TContextFlags

Definition at line 166 of file request_ctx.hpp.

◆ TCount [1/3]

Generic type for counters (posts, requests etc.)

Definition at line 1605 of file ncbidiag.hpp.

◆ TCount [2/3]

Definition at line 2265 of file ncbidiag.hpp.

◆ TCount [3/3]

Definition at line 171 of file request_ctx.hpp.

◆ TDiagPostFlags

Binary OR of "EDiagPostFlag".

Definition at line 785 of file ncbidiag.hpp.

◆ TDiagUserAndHost

Definition at line 56 of file ncbi_userhost.hpp.

◆ TDiagWriteFlags

Definition at line 1708 of file ncbidiag.hpp.

◆ TExtraArg [1/2]

Definition at line 1674 of file ncbidiag.hpp.

◆ TExtraArg [2/2]

Definition at line 1863 of file ncbidiag.hpp.

◆ TExtraArgs [1/2]

Definition at line 1675 of file ncbidiag.hpp.

◆ TExtraArgs [2/2]

Definition at line 1864 of file ncbidiag.hpp.

◆ TFields

typedef list<string> CNcbiLogFields::TFields
private

Definition at line 2420 of file ncbidiag.hpp.

◆ TFlags [1/2]

Definition at line 577 of file request_ctx.hpp.

◆ TFlags [2/2]

Definition at line 61 of file syslog.hpp.

◆ TInfo

Define map for error messages.

Definition at line 3083 of file ncbidiag.hpp.

◆ TMessages [1/2]

typedef list<SDiagMessage> CDiagContext::TMessages
private

Definition at line 2349 of file ncbidiag.hpp.

◆ TMessages [2/2]

Save messages if the handle is unavailable.

Definition at line 2682 of file ncbidiag.hpp.

◆ TNcbiLog_Context

Definition at line 311 of file ncbi_c_log.h.

◆ TNcbiLog_Counter

Definition at line 305 of file ncbi_c_log.h.

◆ TNcbiLog_Int8

Big integer type.

Definition at line 289 of file ncbi_c_log.h.

◆ TNcbiLog_MTLock

Definition at line 147 of file ncbi_c_log.h.

◆ TNcbiLog_OnForkFlags

Binary OR of "ENcbiLog_OnForkAction".

Definition at line 455 of file ncbi_c_log.h.

◆ TNcbiLog_PID

Process, thread and counter types.

Definition at line 303 of file ncbi_c_log.h.

◆ TNcbiLog_TID

Definition at line 304 of file ncbi_c_log.h.

◆ TNcbiLog_UInt8

typedef unsigned __int64 TNcbiLog_UInt8

Definition at line 290 of file ncbi_c_log.h.

◆ TOnForkFlags

Definition at line 1952 of file ncbidiag.hpp.

◆ TParent [1/2]

Definition at line 2636 of file ncbidiag.hpp.

◆ TParent [2/2]

Definition at line 2700 of file ncbidiag.hpp.

◆ TPassThroughProperties

Definition at line 492 of file request_ctx.hpp.

◆ TPID [1/2]

Process ID.

Definition at line 1600 of file ncbidiag.hpp.

◆ TPID [2/2]

Definition at line 1936 of file ncbidiag.hpp.

◆ TProperties [1/3]

Definition at line 2319 of file ncbidiag.hpp.

◆ TProperties [2/3]

User-defined request properties.

Definition at line 287 of file request_ctx.hpp.

◆ TProperties [3/3]

Definition at line 560 of file request_ctx.hpp.

◆ TPropSet

typedef int CRequestContext::TPropSet
private

Definition at line 418 of file request_ctx.hpp.

◆ TReopenFlags

Definition at line 2477 of file ncbidiag.hpp.

◆ TSharedCounter

Definition at line 129 of file request_ctx.hpp.

◆ TSubHitId

typedef unsigned int CSharedHitId::TSubHitId

Definition at line 102 of file request_ctx.hpp.

◆ TTID [1/2]

Thread ID.

Definition at line 1601 of file ncbidiag.hpp.

◆ TTID [2/2]

Get thread ID used in messages.

Definition at line 2272 of file ncbidiag.hpp.

◆ TUID [1/2]

Unique process ID.

Definition at line 1602 of file ncbidiag.hpp.

◆ TUID [2/2]

Definition at line 1975 of file ncbidiag.hpp.

◆ TVersion

Definition at line 376 of file request_ctx.hpp.

Enumeration Type Documentation

◆ anonymous enum

template<int errorCode, int errorSubcode, int maxErrorSubcode>
anonymous enum
Enumerator
valid 

Definition at line 410 of file ncbidiag.hpp.

◆ anonymous enum

template<int errorCode>
anonymous enum
Enumerator
valid 

Definition at line 427 of file ncbidiag.hpp.

◆ EAction

Action to perform in guard's destructor.

Enumerator
ePrint 

Print all collected messages as is.

eDiscard 

Discard collected messages, default.

ePrintCapped 

Print collected messages at reduced severity.

Definition at line 1303 of file ncbidiag.hpp.

◆ EAppDiagStream

Where to write the application's diagnostics to.

Enumerator
eDS_ToStdout 

To standard output stream.

eDS_ToStderr 

To standard error stream.

eDS_ToStdlog 

Try standard log file (app.name + ".log") in /log/ and current directory, use stderr if both fail.

eDS_ToMemory 

Keep in a temp.memory buffer, see FlushMessages()

eDS_Disable 

Don't write it anywhere.

eDS_User 

Leave as was previously set (or not set) by user.

eDS_AppSpecific 

Call the application's SetupDiag_AppSpecific()

Deprecated:
eDS_Default 

Try standard log file (app.name + ".log") in /log/, use stderr on failure.

eDS_ToSyslog 

To system log daemon.

Definition at line 1780 of file ncbidiag.hpp.

◆ ECode

Enumerator
e100_Continue 
e101_SwitchingProtocols 
e200_Ok 
e201_Created 
e202_Accepted 
e203_NonAuthInformation 
e204_NoContent 
e205_ResetContent 
e206_PartialContent 
e299_PartialContentBrokenConnection 

Non-standard status code - used to indicate broken connection while serving partial-content request.

e300_MultipleChoices 
e301_MovedPermanently 
e302_Found 
e303_SeeOther 
e304_NotModified 
e305_UseProxy 
e307_TemporaryRedirect 
e400_BadRequest 
e401_Unauthorized 
e402_PaymentRequired 
e403_Forbidden 
e404_NotFound 
e405_MethodNotAllowed 
e406_NotAcceptable 
e407_ProxyAuthRequired 
e408_RequestTimeout 
e409_Conflict 
e410_Gone 
e411_LengthRequired 
e412_PreconditionFailed 
e413_RequestEntityTooLarge 
e414_RequestURITooLong 
e415_UnsupportedMediaType 
e416_RangeNotSatisfiable 
e417_ExpectationFailed 
e422_UnprocessableEntity 
e451_Unavailable_For_Legal_Reasons 
e499_BrokenConnection 

Non-standard status code - used to indicate broken connection while serving normal request.

e500_InternalServerError 
e501_NotImplemented 
e502_BadGateway 
e503_ServiceUnavailable 
e504_GatewayTimeout 
e505_HTTPVerNotSupported 

Definition at line 57 of file request_status.hpp.

◆ EContextFlags

Request context flags.

Enumerator
fResetOnStart 

Reset values when printing request-start.

fDefault 

Definition at line 161 of file request_ctx.hpp.

◆ EDefaultHitIDFlags

Enumerator
eHitID_NoCreate 
eHitID_Create 

Definition at line 2335 of file ncbidiag.hpp.

◆ EDiagAppState

Application execution states shown in the std prefix.

Enumerator
eDiagAppState_NotSet 

Reserved value, never used in messages.

eDiagAppState_AppBegin 

AB.

eDiagAppState_AppRun 

A.

eDiagAppState_AppEnd 

AE.

eDiagAppState_RequestBegin 

RB.

eDiagAppState_Request 

R.

eDiagAppState_RequestEnd 

RE.

Definition at line 789 of file ncbidiag.hpp.

◆ EDiagCollectMessages

Flags to control collecting messages and flushing them to the new destination when switching diag handlers.

Enumerator
eDCM_Init 

Start collecting messages (with limit), do nothing if already initialized.

eDCM_InitNoLimit 

Start collecting messages without limit (must stop collecting later using eDCM_Flush or eDCM_Discard).

eDCM_NoChange 

Continue collecting messages if already started.

eDCM_Flush 

Flush the collected messages and stop collecting.

eDCM_Discard 

Discard the collected messages without flushing.

Definition at line 1798 of file ncbidiag.hpp.

◆ EDiagFileType

CDiagHandler –.

Base diagnostic handler class. Type of file for the output

Enumerator
eDiagFile_Err 

Error log file.

eDiagFile_Log 

Access log file.

eDiagFile_Trace 

Trace log file.

eDiagFile_Perf 

Perf log file.

eDiagFile_All 

All log files.

Definition at line 2434 of file ncbidiag.hpp.

◆ EDiagFilter

Diag severity types to put the filter on.

See also
SetDiagFilter
Enumerator
eDiagFilter_Trace 

for TRACEs only

eDiagFilter_Post 

for all non-TRACE, non-FATAL

eDiagFilter_All 

for all non-FATAL

Definition at line 2528 of file ncbidiag.hpp.

◆ EDiagPostFlag

Which parts of the diagnostic context should be posted.

Generic appearance of the posted message is as follows:

[<date> <time> ][T<TID> ][["[<path>]/<file>", ][line <line>]: ] [<severity>: ][(<err_code>.<err_subcode>) ] [<module>[::<class>]::][<function>()] - [<prefix1>::<prefix2>::<prefixN>] <message>
[ [<err_code_message>
] [<err_code_explanation>
]

Example:

  • If all flags are set, and prefix string is set to "My prefix", and ERR_POST(eDiag_Warning, "Take care!"): "/home/iam/myfile.cpp", line 33: Warning: (2.11) Module::Class::Function() - [My prefix] Take care!
See also
SDiagMessage::Compose()
Enumerator
eDPF_File 

File name (not full path)

eDPF_LongFilename 

Full file path.

eDPF_Line 

Source line.

eDPF_Prefix 

Prefix (default)

eDPF_Severity 

Severity (default)

eDPF_ErrorID 

Error code and subcode (default)

eDPF_DateTime 

Include date and time.

eDPF_ErrCodeMessage 

Error code message (default)

eDPF_ErrCodeExplanation 

Error explanation (default)

eDPF_ErrCodeUseSeverity 

Use severity from error code (default)

eDPF_Location 

Include class and function if any.

eDPF_TID 

Thread ID.

eDPF_PID 
Deprecated:
eDPF_SerialNo 
Deprecated:
eDPF_SerialNo_Thread 
Deprecated:
eDPF_RequestId 
Deprecated:
eDPF_Iteration 
Deprecated:
eDPF_UID 
Deprecated:
eDPF_ErrCode 
Deprecated:
eDPF_ErrSubCode 
Deprecated:
eDPF_All 

All flags (except for the "unusual" ones!)

eDPF_Trace 

Default flags to use when tracing.

eDPF_Exception 

Default flags to use for exception formatting.

eDPF_Log 

Print the posted message only; without severity, location, prefix, etc.

eDPF_ErrCodeMsgInFront 

Put ErrCode text in front of the message.

eDPF_MergeLines 

Escape EOLs.

eDPF_PreMergeLines 

Obsolete. Use eDPF_MergeLines.

eDPF_OmitInfoSev 

No sev. indication if eDiag_Info.

eDPF_OmitSeparator 

No '—' separator before message.

eDPF_AppLog 

Post message to application log.

eDPF_IsNote 

Print "Note[X]" severity name.

eDPF_IsMessage 
eDPF_AtomicWrite 

This flag is deprecated and ignored - all log writes are atomic.

For compatibility IsSetDiagPostFlag always returns true when asked about this flag.

Deprecated:
eDPF_IsConsole 

Send the message to 'console' regardless of it's severity.

To be set by 'Console' manipulator only.

eDPF_Default 

Use global default flags (merge with).

See also
SetDiagPostFlag(), UnsetDiagPostFlag(), IsSetDiagPostFlag()
eDPF_ImportantFlagsMask 

Important bits which should be taken from the globally set flags even if a user attempts to override (or forgets to set) them when calling CNcbiDiag().

eDPF_UseExactUserFlags 

Use flags provided by user as-is, do not allow CNcbiDiag to replace "important" flags by the globally set ones.

Definition at line 692 of file ncbidiag.hpp.

◆ EDiagSev

enum EDiagSev

Severity level for the posted diagnostics.

Enumerator
eDiag_Info 

Informational message.

eDiag_Warning 

Warning message.

eDiag_Error 

Error message.

eDiag_Critical 

Critical error message.

eDiag_Fatal 

Fatal error – guarantees exit(or abort)

eDiag_Trace 

Trace message.

eDiagSevMin 

Verbosity level for min. severity.

eDiagSevMax 

Verbosity level for max. severity.

Definition at line 650 of file ncbidiag.hpp.

◆ EDiagSevChange

Severity level change state.

Enumerator
eDiagSC_Unknown 

Status of changing severity is unknown (first call)

eDiagSC_Disable 

Disable change severity level.

eDiagSC_Enable 

Enable change severity level.

Definition at line 666 of file ncbidiag.hpp.

◆ EDiagTrace

enum EDiagTrace

Which setting disables/enables posting of "eDiag_Trace" messages.

By default, trace messages are disabled unless:

  • Environment variable $DIAG_TRACE is set (to any value), or
  • Registry value of DIAG_TRACE, section DEBUG is set (to any value)
Enumerator
eDT_Default 

Restores the default tracing context.

eDT_Disable 

Ignore messages of severity "eDiag_Trace".

eDT_Enable 

Enable messages of severity "eDiag_Trace".

Definition at line 1547 of file ncbidiag.hpp.

◆ EDiagUserAndHost

Flags for SetDiagUserAndHost()

Enumerator
fDiag_AddUser 

Add username to diag context.

fDiag_AddHost 

Add hostname to diag context.

fDiag_OverrideExisting 

Set current user and host even if they are already set.

Definition at line 50 of file ncbi_userhost.hpp.

◆ EDiagWriteFlags

Compose a message string in the standard format(see also "flags"): "<file>", line <line>: <severity>: [<prefix>] <message> [EOL] and put it to string "str", or write to an output stream "os".

Which write flags should be output in diagnostic message.

Enumerator
fNone 

No flags.

fNoEndl 

No end of line.

fNoPrefix 

No std prefix.

Definition at line 1702 of file ncbidiag.hpp.

◆ EErrCode

Error types that CRequestContext can generate.

These generic error conditions can occur for corelib applications.

Enumerator
eBadSession 

Invalid session id.

eBadHit 

Invalid hit id.

Definition at line 620 of file request_ctx.hpp.

◆ EEventType

Type of event to report.

Enumerator
eEvent_Start 

Application start.

eEvent_Stop 

Application exit.

eEvent_Extra 

Other application events.

eEvent_RequestStart 

Start processing request.

eEvent_RequestStop 

Finish processing request.

eEvent_PerfLog 

Performance log.

Definition at line 1640 of file ncbidiag.hpp.

◆ EFacility

Enumerator
eDefaultFacility 
eKernel 
eUser 
eMail 
eDaemon 
eAuth 
eSysLog 
eLPR 
eNews 
eUUCP 
eCron 
eAuthPriv 
eFTP 
eLocal0 
eLocal1 
eLocal2 
eLocal3 
eLocal4 
eLocal5 
eLocal6 
eLocal7 

Definition at line 74 of file syslog.hpp.

◆ EFlags [1/2]

Enumerator
fPrintRequestStart 

Print request-start automatically in the constructor.

By default request-start is not printed to allow the caller log request arguments.

Definition at line 571 of file request_ctx.hpp.

◆ EFlags [2/2]

Enumerator
fNoOverride 

never call openlog() ourselves

fCopyToStderr 

maps to LOG_PERROR if available

fFallBackToConsole 

LOG_CONS.

fIncludePID 

LOG_PID.

fConnectNow 

LOG_NDELAY.

fNoChildWait 

LOG_NOWAIT.

fAllFlags 

Definition at line 52 of file syslog.hpp.

◆ EFormat

Supported serialization/deserialization formats.

Enumerator
eFormat_UrlEncoded 

name=value pairs URL-encoded and separated with '&'

Definition at line 522 of file request_ctx.hpp.

◆ EFormatFlag

Enumerator
eFormat_Old 
eFormat_New 
eFormat_Auto 

Definition at line 1738 of file ncbidiag.hpp.

◆ EHitIDSource

Hit ID Allowed source of the current hit id.

See also
IsSetHitID
Enumerator
eHitID_Any 

Any hit id - always return true.

eHitID_Request 

Check if per-request hit id is set.

eHitID_Default 

Check if default hit id is set.

eHidID_Existing 

Check if any hit is already available (will not be generated on request).

Definition at line 212 of file request_ctx.hpp.

◆ ELogRate_Type

Type of logging rate limit.

Enumerator
eLogRate_App 

Application log.

eLogRate_Err 

Error log.

eLogRate_Trace 

Trace log.

Definition at line 2276 of file ncbidiag.hpp.

◆ ENcbiLog_AppState

Application execution states shown in the std prefix.

See also
NcbiLog_GetState
Enumerator
eNcbiLog_NotSet 

Reserved value, never used in messages.

eNcbiLog_AppBegin 

PB.

eNcbiLog_AppRun 

P.

eNcbiLog_AppEnd 

PE.

eNcbiLog_RequestBegin 

RB.

eNcbiLog_Request 

R.

eNcbiLog_RequestEnd 

RE.

Definition at line 995 of file ncbi_c_log.h.

◆ ENcbiLog_Destination

Where to write the application's diagnostics to.

See also
NcbiLog_SetDestination
Enumerator
eNcbiLog_Default 

Try /log/<*>/<appname>.log; fallback to STDERR.

eNcbiLog_Stdlog 

Try /log/<*>/<appname>.log; fallback to .

/<appname>.log, then to STDERR

eNcbiLog_Cwd 

Try .

/<appname>.log, fallback to STDERR

eNcbiLog_File 

To specific file, see NcbiLog_SetDestinationFile()

eNcbiLog_Stdout 

To standard output stream.

eNcbiLog_Stderr 

To standard error stream.

eNcbiLog_Disable 

Don't write it anywhere.

Definition at line 246 of file ncbi_c_log.h.

◆ ENcbiLog_MTLock_Action

The action passed to user defined MT lock handler.

Enumerator
eNcbiLog_MT_Init 

Init the locker (call first)

eNcbiLog_MT_Lock 

Lock.

eNcbiLog_MT_Unlock 

Unlock.

eNcbiLog_MT_Destroy 

Unlock and cleanup (call last)

Definition at line 152 of file ncbi_c_log.h.

◆ ENcbiLog_MTLock_Ownership

Type of ownership for MT lock handle.

Enumerator
eNcbiLog_MT_NoOwnership 

No ownership relationship.

eNcbiLog_MT_TakeOwnership 

NcbiLog API takes ownership of MT lock.

Definition at line 162 of file ncbi_c_log.h.

◆ ENcbiLog_OnForkAction

Actions to perform in NcbiLog_UpdateOnFork()

Enumerator
fNcbiLog_OnFork_UpdateID 

Update IDs (default)

fNcbiLog_OnFork_PrintStart 

Log app-start.

fNcbiLog_OnFork_ResetTimer 

Reset execution timer.

Definition at line 447 of file ncbi_c_log.h.

◆ ENcbiLog_Severity

Severity level for the posted diagnostics.

Enumerator
eNcbiLog_Trace 

Trace message.

eNcbiLog_Info 

Informational message.

eNcbiLog_Warning 

Warning message.

eNcbiLog_Error 

Error message.

eNcbiLog_Critical 

Critical error message.

eNcbiLog_Fatal 

Fatal error – guarantees exit (or abort)

Definition at line 261 of file ncbi_c_log.h.

◆ EOnBadSessionID

Session ID error actions.

Enumerator
eOnBadSID_Allow 

Don't validate session id.

eOnBadSID_AllowAndReport 

Accept but show warning (default).

eOnBadSID_Ignore 

Ignore bad session id.

eOnBadSID_IgnoreAndReport 

Ignore and show warning.

eOnBadSID_Throw 

Throw on bad session id.

Definition at line 321 of file request_ctx.hpp.

◆ EPostNumberIncrement

Post number increment flag for GetProcessPostNumber() and GetThreadPostNumber().

Enumerator
ePostNumber_NoIncrement 

Get post number without incrementing it.

ePostNumber_Increment 

Increment and return the new post number.

Definition at line 1811 of file ncbidiag.hpp.

◆ EPriority

Enumerator
eEmergency 
eAlert 
eCritical 
eError 
eWarning 
eNotice 
eInfo 
eDebug 

Definition at line 63 of file syslog.hpp.

◆ EProperty

Enumerator
eProp_RequestID 
eProp_ClientIP 
eProp_SessionID 
eProp_HitID 
eProp_ReqStatus 
eProp_BytesRd 
eProp_BytesWr 
eProp_Dtab 

Definition at line 408 of file request_ctx.hpp.

◆ EPropertyMode

Property visibility flag.

Deprecated:
Enumerator
eProp_Default 

Auto-mode for known properties, local for others.

eProp_Global 

The property is global for the application.

eProp_Thread 

The property has separate value in each thread.

Definition at line 2014 of file ncbidiag.hpp.

◆ EReopenFlags

Enumerator
fTruncate 

Truncate file to zero size.

fCheck 

Reopen only if necessary.

fDefault 

Default reopen flags:

  • no truncation
  • do not check if necessary

Definition at line 2470 of file ncbidiag.hpp.

◆ ESessionIDFormat

Session ID format.

Enumerator
eSID_Ncbi 

Strict NCBI format: (UID:16)_(RqID:4+)SID.

eSID_Standard 

Alpanum, underscore, -.:@, (default)

eSID_Other 

Any other format.

Definition at line 315 of file request_ctx.hpp.

◆ EStart

If to start the timing immediately.

Enumerator
eStart 

Call Start() immediately after creating.

eSuspend 

Do not start timer (call Start() later)

Definition at line 83 of file perf_log.hpp.

◆ FLoggedHitIDFlag

Enumerator
fLoggedOnRequest 
fLoggedOnError 

Definition at line 460 of file request_ctx.hpp.

◆ FOnForkAction

Actions to perform in UpdateOnFork().

Enumerator
fOnFork_PrintStart 

Log app-start.

fOnFork_ResetTimer 

Reset execution timer.

fOnFork_AsyncSafe 

After a fork() in a multithreaded program, the child can safely call only async-signal-safe functions.

So we can do only a limited set of operations updating diag context there. Cancels both previous flags as not async-signal-safe.

Definition at line 1944 of file ncbidiag.hpp.

Function Documentation

◆ Abort()

NCBI_XNCBI_EXPORT void Abort ( void  )

◆ AddParameter()

CPerfLogGuard & CPerfLogGuard::AddParameter ( CTempString  name,
CTempString  value 
)
inline

Add info to the resource's description.

Definition at line 565 of file perf_log.hpp.

References ERR_POST_ONCE, Error(), CPerfLogger::m_IsDiscarded, CPerfLogGuard::m_Logger, CPerfLogGuard::m_Parameters, and rapidjson::value.

◆ AddPassThroughProperty()

void CRequestContext::AddPassThroughProperty ( const string name,
const string value 
)

◆ Adjust()

void CPerfLogger::Adjust ( CTimeSpan  timespan)
inline

Adjust the printed elapsed time.

Parameters
timespanAdjustment value, can be positive or negative. The value is added to the actual elapsed time before logging it in Post(), if the resuling adjusted timespan is negative, zero is logged. Multiple adjustments are accumulated.
Note
The adjustment does not affect the actual elapsed time counted by the stopwatch (if used), only the printed value is adjusted.

Definition at line 454 of file perf_log.hpp.

References CTimeSpan::GetAsDouble(), and CPerfLogger::m_Adjustment.

Referenced by g_DoErasePerfLogging(), g_DoPerfLogging(), and s_DoDonePerfLogging().

◆ AllowAsyncWrite() [1/3]

bool CDiagHandler::AllowAsyncWrite ( const SDiagMessage msg) const
virtual

Check if the handler supports async writes.

See also
ComposeMessage, WriteMessage

Reimplemented in CFileDiagHandler, and CFileHandleDiagHandler.

Definition at line 6383 of file ncbidiag.cpp.

◆ AllowAsyncWrite() [2/3]

bool CFileHandleDiagHandler::AllowAsyncWrite ( const SDiagMessage msg) const
virtual

Check if the handler supports async writes.

See also
ComposeMessage, WriteMessage

Reimplemented from CDiagHandler.

Definition at line 6661 of file ncbidiag.cpp.

◆ AllowAsyncWrite() [3/3]

bool CFileDiagHandler::AllowAsyncWrite ( const SDiagMessage msg) const
virtual

Check if the handler supports async writes.

See also
ComposeMessage, WriteMessage

Reimplemented from CDiagHandler.

Definition at line 7124 of file ncbidiag.cpp.

References CFileDiagHandler::x_GetDiagFileType(), and CFileDiagHandler::x_GetHandler().

◆ AllowBadSymbolsInArgNames()

CDiagContext_Extra & CDiagContext_Extra::AllowBadSymbolsInArgNames ( void  )

Allow bad symbols in argument names.

URL-encode names the same way as values. NOTE: Avoid using this method if possible. Argument names with encoded symbols may be incompatible with some logging tools. If the flag is not set, any bad symbol is replaced with [ILLEGAL_APPLOG_SYMBOL:%##] string, where %## is the URL-encoded symbol.

Definition at line 2213 of file ncbidiag.cpp.

References CDiagContext_Extra::m_AllowBadNames.

◆ AppendDiagFilter()

void AppendDiagFilter ( EDiagFilter  what,
const char *  filter_str 
)

Append diagnostic filter.

Parameters
whatFilter is set for
filter_strFilter string
See also
SetDiagFilter

Definition at line 7694 of file ncbidiag.cpp.

References eDiagFilter_All, eDiagFilter_Post, eDiagFilter_Trace, CDiagLock::eWrite, s_PostFilter, and s_TraceFilter.

◆ ApproveMessage()

bool CDiagContext::ApproveMessage ( SDiagMessage msg,
bool show_warning 
)
private

◆ CAsyncDiagHandler()

CAsyncDiagHandler::CAsyncDiagHandler ( void  )

Definition at line 7209 of file ncbidiag.cpp.

◆ CDiagAutoPrefix() [1/2]

CDiagAutoPrefix::CDiagAutoPrefix ( const char *  prefix)

Constructor.

Definition at line 6014 of file ncbidiag.cpp.

References prefix, and PushDiagPostPrefix().

◆ CDiagAutoPrefix() [2/2]

CDiagAutoPrefix::CDiagAutoPrefix ( const string prefix)

Constructor.

Definition at line 6009 of file ncbidiag.cpp.

References prefix, and PushDiagPostPrefix().

◆ CDiagCollectGuard() [1/3]

CDiagCollectGuard::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).

The default action is eDiscard.

Definition at line 522 of file ncbidiag.cpp.

References eDiag_Critical, CDiagCollectGuard::eDiscard, and CDiagCollectGuard::x_Init().

◆ CDiagCollectGuard() [2/3]

CDiagCollectGuard::CDiagCollectGuard ( EDiagSev  print_severity,
EDiagSev  collect_severity,
EAction  action = eDiscard 
)

Create diag collect guard with the given severities and action.

As with the other constructor variants, the optionally applied print-severity cap defaults to the collectable severity. The guard will not set print severity below the current diag post level (or print severity of a higher level guard). Collect severity should be equal or lower than the current diag post level or collect severity. The default action is eDiscard.

Definition at line 529 of file ncbidiag.cpp.

References CDiagCollectGuard::x_Init().

◆ CDiagCollectGuard() [3/3]

CDiagCollectGuard::CDiagCollectGuard ( void  )

Set collectable severity and optionally applied print-severity cap to the current post level, Print severity is set to critical.

The default action is eDiscard.

Definition at line 515 of file ncbidiag.cpp.

References eDiag_Critical, eDiag_Fatal, CDiagCollectGuard::eDiscard, and CDiagCollectGuard::x_Init().

◆ CDiagCompileInfo() [1/3]

CDiagCompileInfo::CDiagCompileInfo ( const char *  file,
int  line,
const char *  curr_funct = NULL,
const char *  module = NULL 
)

◆ CDiagCompileInfo() [2/3]

CDiagCompileInfo::CDiagCompileInfo ( const string file,
int  line,
const string curr_funct,
const string module 
)

◆ CDiagCompileInfo() [3/3]

CDiagCompileInfo::CDiagCompileInfo ( void  )

CDiagCompileInfo::

Definition at line 1284 of file logging.cpp.

◆ CDiagContext() [1/2]

CDiagContext::CDiagContext ( const CDiagContext )
private

◆ CDiagContext() [2/2]

CDiagContext::CDiagContext ( void  )

Definition at line 1298 of file ncbidiag.cpp.

References eStart, and CDiagContext::sm_Instance.

◆ CDiagContext_Extra() [1/3]

CDiagContext_Extra::CDiagContext_Extra ( const CDiagContext_Extra args)

Copying the object will prevent printing it on destruction.

The new copy should take care of printing.

Definition at line 2199 of file ncbidiag.cpp.

◆ CDiagContext_Extra() [2/3]

CDiagContext_Extra::CDiagContext_Extra ( int  status,
double  timespan,
TExtraArgs args 
)
private

Definition at line 2181 of file ncbidiag.cpp.

References CDiagContext_Extra::m_Args.

◆ CDiagContext_Extra() [3/3]

CDiagContext_Extra::CDiagContext_Extra ( SDiagMessage::EEventType  event_type)
private

Definition at line 2168 of file ncbidiag.cpp.

◆ CDiagErrCodeInfo() [1/3]

CDiagErrCodeInfo::CDiagErrCodeInfo ( CNcbiIstream is)

Constructor – can throw runtime_error.

◆ CDiagErrCodeInfo() [2/3]

CDiagErrCodeInfo::CDiagErrCodeInfo ( const string file_name)

Constructor – can throw runtime_error.

◆ CDiagErrCodeInfo() [3/3]

CDiagErrCodeInfo::CDiagErrCodeInfo ( void  )

Constructor.

◆ CDiagRestorer()

CDiagRestorer::CDiagRestorer ( void  )

◆ CFileDiagHandler()

CFileDiagHandler::CFileDiagHandler ( void  )

Constructor.

initializes log file(s) with the arguments.

See also
SetLogFile

Definition at line 6727 of file ncbidiag.cpp.

References eDiagFile_All, and CFileDiagHandler::SetLogFile().

◆ CFileHandleDiagHandler()

CFileHandleDiagHandler::CFileHandleDiagHandler ( const string fname,
EDiagFileType  file_type = eDiagFile_All 
)

Constructor.

Open file handle. themselves if appropriate.

Parameters
fnameOutput file name.
file_typeType of log file.

Definition at line 6490 of file ncbidiag.cpp.

References CDiagHandler::fDefault, CDiagHandler::fTruncate, CDiagContext::GetLogTruncate(), CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::SetLogName().

◆ CheckErrSubcodeX()

void CheckErrSubcodeX ( int  )
inline

Additional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro.

Definition at line 442 of file ncbidiag.hpp.

◆ CheckFilters()

bool CNcbiDiag::CheckFilters ( const CException ex = NULL) const

Check if filters are passed for the current message.

In addition check an exception and all its backlog if specified.

Definition at line 7774 of file ncbidiag.cpp.

References eDiag_Fatal, eDiag_Trace, eDiagFilter_Reject, CDiagLock::eRead, CNcbiDiag::GetSeverity(), s_PostFilter, and s_TraceFilter.

Referenced by CNcbiDiag::x_Put().

◆ CJaegerTracer() [1/3]

CJaegerTracer::CJaegerTracer ( const string service_name)

Create tracer using the service name and the environment varibles to populate configuration.

Definition at line 94 of file jaeger_tracer.cpp.

References s_GetDefaultConfig(), and s_InitTracer().

◆ CJaegerTracer() [2/3]

CJaegerTracer::CJaegerTracer ( const string service_name,
const jaegertracing::Config &  config 
)

Create tracer using the service name and config.

Definition at line 101 of file jaeger_tracer.cpp.

References s_InitTracer().

◆ CJaegerTracer() [3/3]

CJaegerTracer::CJaegerTracer ( void  )

Create tracer using default settings:

  • service name = application display name or JAEGER_SERVICE_NAME environment variable
  • sampler = const/1 or JAEGER_SAMPLER_TYPE/JAEGER_SAMPLER_PARAM environment variables See also Jaeger client documentation: https://github.com/jaegertracing/jaeger-client-cpp

Definition at line 82 of file jaeger_tracer.cpp.

References CNcbiApplicationAPI::InstanceGuard(), s_GetDefaultConfig(), and s_InitTracer().

◆ CJaegerTracerSpan()

CJaegerTracerSpan::CJaegerTracerSpan ( shared_ptr< jaegertracing::Span >  span)
inline

Definition at line 57 of file jaeger_tracer.hpp.

◆ Clear()

void CDiagErrCodeInfo::Clear ( void  )

Delete all stored error descriptions from memory.

◆ Clone()

CRef< CRequestContext > CRequestContext::Clone ( void  ) const

Copy current request context to a new one.

The method can be used to process a single request in several threads which share the same information (request id, session id etc.). NOTE: The new context is not linked to the parent one. No further changes in a context are copied to its clones. It's the developer's responsibility to track multiple clones and make sure that they are used properly (e.g. status is set by just one thread; only one request-stop is printed and no clones continue to log the same request after it's stopped).

Definition at line 571 of file request_ctx.cpp.

References CEncodedString::GetOriginalString(), CRequestContext::m_AppState, CRequestContext::m_AutoIncOnPost, CRequestContext::m_BytesRd, CRequestContext::m_BytesWr, CRequestContext::m_ClientIP, CRequestContext::m_Dtab, CRequestContext::m_Flags, CRequestContext::m_HitID, CRequestContext::m_HitIDLoggedFlag, CRequestContext::m_IsReadOnly, CRequestContext::m_IsRunning, CRequestContext::m_Properties, CRequestContext::m_PropSet, CRequestContext::m_ReqStatus, CRequestContext::m_ReqTimer, CRequestContext::m_RequestID, CRequestContext::m_SessionID, CRequestContext::m_SubHitIDCache, CSharedHitId::SetShared(), and CEncodedString::SetString().

Referenced by CPSG_Request::GetCtx(), CAsyncWriteCache::GetWriteStream(), CThread::Run(), and CPSGS_Request::SetRequestContext().

◆ CNcbiDiag() [1/3]

CNcbiDiag::CNcbiDiag ( const CDiagCompileInfo info,
EDiagSev  sev = eDiag_Error,
TDiagPostFlags  post_flags = eDPF_Default 
)

Constructor – includes the file and line number info.

Parameters
infoFile, line, module
sevSeverity level
post_flagsWhat to post

Definition at line 7720 of file ncbidiag.cpp.

◆ CNcbiDiag() [2/3]

CNcbiDiag::CNcbiDiag ( const CNcbiDiag )
private

Private copy constructor to prohibit copy.

◆ CNcbiDiag() [3/3]

CNcbiDiag::CNcbiDiag ( EDiagSev  sev = eDiag_Error,
TDiagPostFlags  post_flags = eDPF_Default 
)

Constructor.

Parameters
sevSeverity level
post_flagsWhat to post

Definition at line 7709 of file ncbidiag.cpp.

Referenced by CNcbiDiag::DiagAssert(), CNcbiDiag::DiagFatal(), and CNcbiDiag::DiagTrouble().

◆ CNcbiLogFields()

CNcbiLogFields::CNcbiLogFields ( const string source)

Load fields to be logged from NCBI_LOG_FIELDS environment variable.

Definition at line 3897 of file ncbidiag.cpp.

References _T_CSTRING, _TX, NStr::fSplit_Tokenize, CNcbiLogFields::m_Fields, NcbiSys_getenv, NStr::ReplaceInPlace(), NStr::Split(), and NStr::ToLower().

◆ CompareDiagPostLevel()

int CompareDiagPostLevel ( EDiagSev  sev1,
EDiagSev  sev2 
)

Compare two severities.

Returns
The return value is negative if the first value is lower than the second one, positive if it's higher than the second one, 0 if the severities are equal.

Definition at line 6157 of file ncbidiag.cpp.

References eDiag_Trace.

Referenced by AdjustApplogPrintableSeverity(), CException::CException(), CException::GetStackTrace(), IsVisibleDiagPostLevel(), CTeeDiagHandler::Post(), CPythonDiagHandler::Post(), CDiagContextThreadData::RemoveCollectGuard(), CDiagCollectGuard::SetCollectSeverity(), CDiagCollectGuard::SetPrintSeverity(), CException::SetSeverity(), CException::x_GetStackTrace(), CDiagCollectGuard::x_Init(), and CNcbiDiag::x_Put().

◆ ComposeMessage() [1/3]

string CDiagHandler::ComposeMessage ( const SDiagMessage msg,
EDiagFileType file_type 
) const
virtual

Compose message without writing it.

If async mode is not supported, return empty string.

Reimplemented in CFileDiagHandler, and CFileHandleDiagHandler.

Definition at line 6389 of file ncbidiag.cpp.

References _ASSERT, and kEmptyStr.

Referenced by CAsyncDiagHandler::Post().

◆ ComposeMessage() [2/3]

string CFileHandleDiagHandler::ComposeMessage ( const SDiagMessage msg,
EDiagFileType file_type 
) const
virtual

Compose message without writing it.

If async mode is not supported, return empty string.

Reimplemented from CDiagHandler.

Definition at line 6667 of file ncbidiag.cpp.

Referenced by CFileHandleDiagHandler::Post(), and CFileHandleDiagHandler::Reopen().

◆ ComposeMessage() [3/3]

string CFileDiagHandler::ComposeMessage ( const SDiagMessage msg,
EDiagFileType file_type 
) const
virtual

Compose message without writing it.

If async mode is not supported, return empty string.

Reimplemented from CDiagHandler.

Definition at line 7131 of file ncbidiag.cpp.

References file_type, kEmptyStr, CFileDiagHandler::x_GetDiagFileType(), and CFileDiagHandler::x_GetHandler().

◆ CPerfLogger() [1/3]

CPerfLogger::CPerfLogger ( const CTime start_time,
double  elapsed_time,
EStart  state = eStart 
)
inline

Constructor.

Use start time and elapsed time values from a previous logger to continue measuring an operation.

Definition at line 368 of file perf_log.hpp.

References CPerfLogger::eStart, CStopWatch::eStop, CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_FirstStartTime, CPerfLogger::m_IsDiscarded, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, CPerfLogger::Start(), and start_time.

◆ CPerfLogger() [2/3]

CPerfLogger::CPerfLogger ( CStopWatch stopwatch,
EStart  state = eStart 
)
inline

Constructor.

Use the provided stopwatch to track time. Start or stop the stopwatch according to the 'state'. The same stopwatch object can be used multiple times to accumulate total time for several operations.

Note
The stopwatch is not copied, so the original object must not be destroyed while the logger is running.
When using a user-provided stopwatch the accumulated elapsed time may be approximate. A better approach is to initialize every new logger with the start time and elapsed time accumulated by the previous one.

Definition at line 383 of file perf_log.hpp.

References CPerfLogger::eStart, CStopWatch::eStop, CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_IsDiscarded, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, and CPerfLogger::Start().

◆ CPerfLogger() [3/3]

CPerfLogger::CPerfLogger ( EStart  state = eStart)
inline

◆ CPerfLogGuard() [1/3]

CPerfLogGuard::CPerfLogGuard ( CTempString  resource,
const CTime start_time,
double  elapsed_time,
CPerfLogger::EStart  state = CPerfLogger::eStart 
)
inline

Constructor.

Use the provided start and elapsed times to initialize the logger and continue to measure an operation.

Parameters
resourceName of the resource (must be non-empty, else throws an exception).
start_timeStart time, usually obtained from a previous logger to continue measuring an operation.
elapsed_timeElapsed time in seconds obtained from a previous logger.
stateWhether to start the timer by default.

Definition at line 511 of file perf_log.hpp.

References CTempString::empty(), and NCBI_THROW.

◆ CPerfLogGuard() [2/3]

CPerfLogGuard::CPerfLogGuard ( CTempString  resource,
CPerfLogger::EStart  state = CPerfLogger::eStart 
)
inline

Constructor.

Parameters
resourceName of the resource (must be non-empty, else throws an exception).
stateWhether to start the timer by default.

Definition at line 500 of file perf_log.hpp.

References CTempString::empty(), and NCBI_THROW.

◆ CPerfLogGuard() [3/3]

CPerfLogGuard::CPerfLogGuard ( CTempString  resource,
CStopWatch stopwatch,
CPerfLogger::EStart  state = CPerfLogger::eStart 
)
inline

Constructor.

Parameters
resourceName of the resource (must be non-empty, else throws an exception). Constructor. Use the provided stopwatch to track time.
stopwatchUser-provided stopwatch to use for tracking time. The same stopwatch object can be used multiple times to accumulate total time for several operations.
stateWhether to start the timer by default.
Note
The stopwatch is not copied, so the original object must not be destroyed while the logger is running.

Definition at line 525 of file perf_log.hpp.

References CTempString::empty(), and NCBI_THROW.

◆ CRequestContext() [1/2]

CRequestContext::CRequestContext ( const CRequestContext )
private

◆ CRequestContext() [2/2]

CRequestContext::CRequestContext ( TContextFlags  flags = fDefault)

Definition at line 165 of file request_ctx.cpp.

References eStop, and CRequestContext::x_LoadEnvContextProperties().

◆ CRequestContext_PassThrough() [1/2]

CRequestContext_PassThrough::CRequestContext_PassThrough ( CRequestContext  ctx)
inline

Get CRequestContext_PassThrough for the specific request context.

Definition at line 972 of file request_ctx.hpp.

◆ CRequestContext_PassThrough() [2/2]

CRequestContext_PassThrough::CRequestContext_PassThrough ( void  )
inline

Get CRequestContext_PassThrough for the current request context.

Definition at line 965 of file request_ctx.hpp.

References GetDiagContext(), CRequestContext_PassThrough::m_Context, and CRef< C, Locker >::Reset().

◆ CRequestContextGuard_Base()

CRequestContextGuard_Base::CRequestContextGuard_Base ( CRequestContext context,
TFlags  flags = 0 
)

Initialize guard.

Parameters
contextRequest context to be used. If null, re-use current context.
flagsOptional flags,
See also
FFlags.

Definition at line 901 of file request_ctx.cpp.

References context, ctx, CRequestContextGuard_Base::fPrintRequestStart, GetDiagContext(), CRequestContextGuard_Base::m_Flags, CRequestContextGuard_Base::m_OriginatesFromThrow, CRequestContextGuard_Base::m_RequestContext, CRequestContextGuard_Base::m_SavedContext, and CRef< C, Locker >::Reset().

◆ CSharedHitId() [1/2]

CSharedHitId::CSharedHitId ( const string hit_id)
inlineexplicit

Set new hit id, checks its validity.

Definition at line 68 of file request_ctx.hpp.

References CSharedHitId::x_SetHitId().

◆ CSharedHitId() [2/2]

CSharedHitId::CSharedHitId ( void  )
inline

Definition at line 74 of file request_ctx.hpp.

◆ CStreamDiagHandler()

CStreamDiagHandler::CStreamDiagHandler ( CNcbiOstream os,
bool  quick_flush = true,
const string stream_name = "" 
)

Constructor.

This does *not* own the stream; users will need to clean it up themselves if appropriate.

Parameters
osOutput stream.
quick_flushDo stream flush after every message.

Definition at line 6422 of file ncbidiag.cpp.

References CStreamDiagHandler_Base::SetLogName().

◆ CStreamDiagHandler_Base()

CStreamDiagHandler_Base::CStreamDiagHandler_Base ( void  )

Definition at line 6402 of file ncbidiag.cpp.

References kLogName_Stream, and CStreamDiagHandler_Base::SetLogName().

◆ CSysLog() [1/2]

CSysLog::CSysLog ( const string ident,
TFlags  flags,
int  default_facility 
)

Definition at line 75 of file syslog.cpp.

References CSysLog::fConnectNow, flags, NCBI_THROW, and CSysLog::x_Connect().

◆ CSysLog() [2/2]

CSysLog::CSysLog ( const string ident = kEmptyStr,
TFlags  flags = fNoOverride,
EFacility  default_facility = eDefaultFacility 
)

Definition at line 60 of file syslog.cpp.

References CSysLog::fConnectNow, flags, NCBI_THROW, and CSysLog::x_Connect().

◆ DECLARE_CLASS_STATIC_MUTEX()

CSysLog::DECLARE_CLASS_STATIC_MUTEX ( sm_Mutex  )
private

◆ DeleteProperty()

void CDiagContext::DeleteProperty ( const string name,
EPropertyMode  mode = eProp_Default 
)

Delete a property by name.

If mode is eProp_Default and the property is not a known one, check thread-local properties first.

Deprecated:

Definition at line 2073 of file ncbidiag.cpp.

References map_checker< Container >::end(), map_checker< Container >::erase(), CDiagLock::eRead, map_checker< Container >::find(), and CDiagContext::m_Properties.

◆ Deserialize()

void CRequestContext_PassThrough::Deserialize ( CTempString  data,
EFormat  format 
)

◆ DiagAssert()

void CNcbiDiag::DiagAssert ( const CDiagCompileInfo info,
const char *  expression,
const char *  message = NULL 
)
static

Assert specified expression and report results.

Definition at line 7944 of file ncbidiag.cpp.

References Abort(), CNcbiDiag::CNcbiDiag(), eDiag_Fatal, eDPF_Trace, CNcbiDiag::Endm, and info.

Referenced by CNcbiDiag::DiagAssertIfSuppressedSystemMessageBox(), and CNcbiDiag::DiagValidate().

◆ DiagAssertIfSuppressedSystemMessageBox()

void CNcbiDiag::DiagAssertIfSuppressedSystemMessageBox ( const CDiagCompileInfo info,
const char *  expression,
const char *  message = NULL 
)
static

Same as DiagAssert but only if the system message box is suppressed.

Definition at line 7955 of file ncbidiag.cpp.

References CNcbiDiag::DiagAssert(), info, and IsSuppressedDebugSystemMessageBox().

◆ DiagFatal()

void CNcbiDiag::DiagFatal ( const CDiagCompileInfo info,
const char *  message 
)
static

Display fatal error message.

Definition at line 7929 of file ncbidiag.cpp.

References Abort(), CNcbiDiag::CNcbiDiag(), eDiag_Fatal, CNcbiDiag::Endm, and info.

◆ DiagHandler_Reopen()

void DiagHandler_Reopen ( void  )

Ask diagnostic handler to reopen log files if necessary.

Definition at line 6344 of file ncbidiag.cpp.

References CDiagHandler::fCheck, and GetDiagHandler().

Referenced by CDefaultIdler::Idle().

◆ DiagTrouble()

void CNcbiDiag::DiagTrouble ( const CDiagCompileInfo info,
const char *  message = NULL 
)
static

◆ DiagValidate()

void CNcbiDiag::DiagValidate ( const CDiagCompileInfo info,
const char *  expression,
const char *  message 
)
static

Display validation message.

Definition at line 7965 of file ncbidiag.cpp.

References CNcbiDiag::DiagAssert(), CCoreException::eCore, eValidate_Throw, info, and xncbi_GetValidateAction().

◆ DisableDiagPostLevelChange()

bool DisableDiagPostLevelChange ( bool  disable_change = true)

Disable change the diagnostic post level.

Consecutive using SetDiagPostLevel() will not have effect.

Definition at line 6186 of file ncbidiag.cpp.

References eDiagSC_Disable, eDiagSC_Enable, and CDiagLock::eWrite.

Referenced by SetDiagFixedPostLevel().

◆ Discard() [1/2]

void CPerfLogger::Discard ( void  )
inline

Discard the timing results; stop and deactivate the timer.

Definition at line 445 of file perf_log.hpp.

References CStopWatch::eStop, CPerfLogger::m_IsDiscarded, and CPerfLogger::m_TimerState.

Referenced by CPerfLogGuard::Discard(), and CPerfLogger::Post().

◆ Discard() [2/2]

void CPerfLogGuard::Discard ( void  )
inline

Discard the results.

Note
After this any action on this guard will be an error (and no-op).

Definition at line 586 of file perf_log.hpp.

References CPerfLogger::Discard(), and CPerfLogGuard::m_Logger.

Referenced by CPerfLogGuard::Post().

◆ DiscardMessages()

void CDiagContext::DiscardMessages ( void  )

Discard the collected messages without printing them.

Definition at line 3411 of file ncbidiag.cpp.

References CDiagContext::m_Messages.

Referenced by CNcbiApplicationAPI::AppMain(), and CNcbiApplicationAPI::FlushDiag().

◆ Empty()

bool CSharedHitId::Empty ( void  ) const
inline

◆ Enumerate()

template<class TCallback >
void CRequestContext_PassThrough::Enumerate ( TCallback  callback)
inline

Enumerate all properties.

The callback must have the following signarure: bool F(const string& name, const string& value); The function should return true to continue enumaration, false to stop.

Definition at line 548 of file request_ctx.hpp.

References ITERATE, CRequestContext_PassThrough::m_Context, CRequestContext::m_PassThroughProperties, and CRequestContext::x_UpdateStdPassThroughProp().

Referenced by CGRPCClientContext::AddStandardNCBIMetadata().

◆ ErrCode()

ErrCode::ErrCode ( int  code,
int  subcode = 0 
)
inline

Constructor.

Definition at line 818 of file ncbidiag.hpp.

◆ Extra()

CDiagContext_Extra CDiagContext::Extra ( void  ) const
inline

Create a temporary CDiagContext_Extra object.

The object will print arguments automatically from destructor. Can be used like: Extra().Print(name1, val1).Print(name2, val2);

Definition at line 2095 of file ncbidiag.hpp.

References CDiagContext::CDiagContext_Extra, and SDiagMessage::eEvent_Extra.

Referenced by CGRPCRequestLogger::CGRPCRequestLogger(), CWNJobWatcher::CheckForInfiniteLoop(), CCgi2RCgiApp::CheckJob(), CVcfTrack::CheckRange(), CompressAssembly(), ColumnarVcfCache::CreateBlob(), CBlastAligner::GenerateAlignments(), CNcbiLogFields::LogFields(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), CPerfLogger::Post(), CDiagContext::PrintStart(), CCgiSampleApplication::ProcessPrintEnvironment(), COperationTiming::Register(), CIgBlast::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), CNetStorageGCApp::Run(), CAdvancedAlignCleanup::RunSplignOnCompartment(), CSparseGraph::Save(), ColumnarVcfCache::SetInfoFields(), CCgi2RCgiApp::SubmitJob(), UncomressAndCreate(), CNgAligner::x_Align_Impl(), CQueue::x_CancelJobs(), CQueue::x_CheckExecutionTimeout(), CSparseGraph::x_CheckRemoteData(), CQueueDataBase::x_CreateAndMountQueue(), CPubseqGatewayApp::x_DispatchRequest(), CSGAlignStatJob::x_Execute(), CNetStorageHandler::x_GetObject(), CGRPCRequestLogger::x_Init(), CNetScheduleHandler::x_LogCommandWithJob(), CDBConnectionFactory::x_LogConnection(), CDiagContext::x_LogEnvironment(), CRequestContext::x_LogHitID(), CDiagContext::x_LogHitID(), CNcbiApplicationAPI::x_LogOptions(), CQueue::x_LogSubmit(), CHttpConnection::x_MaintainBacklog(), CCgiApplication::x_OnEvent(), CQueueDataBase::x_Open(), CNetStorageGCApp::x_PrintFinishCounters(), CNetScheduleHandler::x_PrintGetJobResponse(), CNetStorageHandler::x_PrintMessageRequestStop(), CNetScheduleHandler::x_ProcessChangeAffinity(), CNetScheduleHandler::x_ProcessClearWorkerNode(), CNetStorageHandler::x_ProcessCreate(), CNetScheduleHandler::x_ProcessGetJob(), CNetScheduleHandler::x_ProcessJobExchange(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessReading(), CNetStorageHandler::x_ProcessReconfigure(), CNetScheduleHandler::x_ProcessReloadConfig(), CNetStorageHandler::x_ProcessRelocate(), CNetScheduleHandler::x_ProcessSetAffinity(), CNetScheduleHandler::x_ProcessSetQueue(), CInstancedAligner::x_RunAligner(), CSparseGraph::x_Sync(), and CRequestContext::x_UpdateSubHitID().

◆ Flush()

void CDiagContext_Extra::Flush ( void  )

Print the message and reset object.

The object can then be reused to print a new log line (with a new set of arguments if necessary). This is only possible with 'extra' messages, request start/stop messages can not be reused after flush and will print error message instead.

Definition at line 2332 of file ncbidiag.cpp.

References ctx, NStr::DoubleToString(), eDiag_Info, eDiagAppState_AppRun, eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, SDiagMessage::eEvent_Extra, SDiagMessage::eEvent_PerfLog, SDiagMessage::eEvent_RequestStart, SDiagMessage::eEvent_RequestStop, SDiagMessage::eEvent_Start, NStr::fDoubleFixed, CNcbiDiag::ForceImportantFlags(), GetDiagBuffer(), GetDiagContext(), CDiagContext::IsSetOldPostFormat(), kApplogDiagPostFlags, SDiagMessage::m_AllowBadExtraNames, CDiagContext_Extra::m_AllowBadNames, CDiagContext_Extra::m_Args, SDiagMessage::m_Event, CDiagContext_Extra::m_EventType, SDiagMessage::m_ExtraArgs, CDiagContext_Extra::m_Flushed, CDiagContext_Extra::m_PerfStatus, CDiagContext_Extra::m_PerfTime, CDiagContext_Extra::m_Typed, SDiagMessage::m_TypedExtra, NULL, CDiagContext_Extra::PrintNcbiAppInfoOnRequest(), CDiagContext_Extra::PrintNcbiRoleAndLocation(), s_DisableAppLog, and CDiagContext::x_StartRequest().

Referenced by CGRPCServerCallbacks::BeginRequest(), CNetScheduleServer::Exit(), CStatisticsCounters::PrintServerWide(), CDiagContext::PrintStart(), CQueue::PrintStatistics(), CPubseqGatewayApp::x_CreateRequestContext(), CDiagContext::x_LogEnvironment(), CQueue::x_LogSubmit(), CCgiApplication::x_OnEvent(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageHandler::x_PrintMessageRequestStart(), and CDiagContext_Extra::x_Release().

◆ FlushMessages()

void CDiagContext::FlushMessages ( CDiagHandler handler)

Flush the collected messages to the current diag handler.

Does not clear the collected messages.

Definition at line 3387 of file ncbidiag.cpp.

References eDPF_IsConsole, CTeeDiagHandler::GetOriginalHandler(), CDiagContext::m_Messages, NON_CONST_ITERATE, and tmp.

Referenced by CNcbiApplicationAPI::FlushDiag().

◆ ForceImportantFlags()

TDiagPostFlags CNcbiDiag::ForceImportantFlags ( TDiagPostFlags  flags)
static

Set important flags to their globally set values.

See also
EDiagPostFlags

Definition at line 7737 of file ncbidiag.cpp.

References eDPF_ImportantFlagsMask, eDPF_UseExactUserFlags, flags, and IsSetDiagPostFlag().

Referenced by CDiagContext_Extra::Flush(), and CDiagContext::x_PrintMessage().

◆ FormatExtraMessage()

string SDiagMessage::FormatExtraMessage ( void  ) const

Convert extra arguments to string.

Definition at line 5485 of file ncbidiag.cpp.

References SDiagMessage::m_AllowBadExtraNames, SDiagMessage::m_ExtraArgs, and CStringPairs< TContainer >::Merge().

Referenced by SDiagMessage::x_NewWrite().

◆ g_Diag_Use_RWLock()

void g_Diag_Use_RWLock ( bool  enable = true)

Use RW-lock for synchronization rather than mutex.

NOTE: 1. The function should never be called when there are several threads running. Otherwise the result may be unpredictable. Also, do not call it from any diagnostic framework functions. E.g., it can not be called from CSomeDiagHandler::Post(). The best place to switch is in the very beginning of main(). 2. In many cases switching to RW-lock will not improve the performance. E.g. any stream-based diag handlers including stderr will have to lock a mutex before writing a message anyway. Significant improvement may be seen only when using file handle based handlers which do atomic writes without additional locks. 3. If a custom diag handler is installed, it must take care about synchronization in Post() method. The framework only sets read lock before Post(), so it may be called from multiple threads at the same time. If in doubt, do not turn this on. The returned value is true on success, false if the switching fails for any reason.

Definition at line 88 of file ncbidiag.cpp.

References _ASSERT, _TROUBLE, NCBI_THROW, s_DiagRWLock, and s_DiagUseRWLock.

Referenced by main().

◆ g_DiagUnknownFunction()

const char* g_DiagUnknownFunction ( void  )

Definition at line 8341 of file ncbidiag.cpp.

References kEmptyCStr.

Referenced by s_NCBI_GPR_Log_Function().

◆ Get()

const string & CRequestContext_PassThrough::Get ( CTempString  name) const
inline

Get current property value or empty string if it's not set;.

Definition at line 993 of file request_ctx.hpp.

References CRequestContext_PassThrough::m_Context, and CRequestContext::x_GetPassThroughProp().

Referenced by CNetStorageHandler::x_CreateUser().

◆ GetAction()

EAction CDiagCollectGuard::GetAction ( void  ) const
inline

Get selected on-destroy action.

Definition at line 1360 of file ncbidiag.hpp.

References CDiagCollectGuard::m_Action.

Referenced by CDiagContextThreadData::RemoveCollectGuard().

◆ GetAllowedSessionIDFormat()

CRequestContext::ESessionIDFormat CRequestContext::GetAllowedSessionIDFormat ( void  )
static

Get/set allowed session id format.

Definition at line 559 of file request_ctx.cpp.

Referenced by CRequestContext::IsValidSessionID().

◆ GetAppName() [1/2]

const string & SDiagMessage::GetAppName ( void  ) const

◆ GetAppName() [2/2]

const string & CDiagContext::GetAppName ( void  ) const

◆ GetAppState() [1/3]

EDiagAppState SDiagMessage::GetAppState ( void  ) const

◆ GetAppState() [2/3]

EDiagAppState CDiagContext::GetAppState ( void  ) const

◆ GetAppState() [3/3]

EDiagAppState CRequestContext::GetAppState ( void  ) const

◆ GetAutoIncRequestIDOnPost()

bool CRequestContext::GetAutoIncRequestIDOnPost ( void  ) const
inline

Get auto-increment state.

Definition at line 306 of file request_ctx.hpp.

References CRequestContext::m_AutoIncOnPost.

Referenced by SDiagMessage::SDiagMessage().

◆ GetBadSessionIDAction()

CRequestContext::EOnBadSessionID CRequestContext::GetBadSessionIDAction ( void  )
static

Get/set session id error action.

Definition at line 547 of file request_ctx.cpp.

Referenced by CRequestContext::SetSessionID().

◆ GetBytesRd()

Int8 CRequestContext::GetBytesRd ( void  ) const
inline

◆ GetBytesWr()

Int8 CRequestContext::GetBytesWr ( void  ) const
inline

◆ GetClass() [1/2]

const string& CDiagCompileInfo::GetClass ( void  ) const

◆ GetClass() [2/2]

const char* CNcbiDiag::GetClass ( void  ) const

Get class name of the current message.

Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().

◆ GetClient()

string SDiagMessage::GetClient ( void  ) const

◆ GetClientIP()

string CRequestContext::GetClientIP ( void  ) const
inline

◆ GetCollectSeverity()

EDiagSev CDiagCollectGuard::GetCollectSeverity ( void  ) const
inline

Get current collect severity.

Definition at line 1349 of file ncbidiag.hpp.

References CDiagCollectGuard::m_CollectSev.

Referenced by CDiagContextThreadData::RemoveCollectGuard(), CDiagCollectGuard::x_Init(), and CNcbiDiag::x_Put().

◆ GetCurrentSubHitID()

const string & CRequestContext::GetCurrentSubHitID ( CTempString  prefix = CTempString())
inline

Get the last generated sub-hit id.

Definition at line 783 of file request_ctx.hpp.

References CRequestContext::m_SubHitIDCache, prefix, and CRequestContext::x_UpdateSubHitID().

Referenced by COSGFetch::SetContext(), and CRequestContext::x_UpdateStdPassThroughProp().

◆ GetCurrentSubHitId()

TSubHitId CSharedHitId::GetCurrentSubHitId ( void  ) const
inline

Get current sub-hit id value.

Definition at line 105 of file request_ctx.hpp.

References CSharedHitId::IsShared(), CSharedHitId::m_SharedSubHitId, and CSharedHitId::m_SubHitId.

Referenced by CRequestContext::x_UpdateSubHitID().

◆ GetDefaultAutoIncRequestIDOnPost()

bool CRequestContext::GetDefaultAutoIncRequestIDOnPost ( void  )
static

Get default auto-increment flag.

Definition at line 383 of file request_ctx.cpp.

References CRequestContext::sx_GetDefaultAutoIncRequestIDOnPost().

Referenced by CDiagContextThreadData::CDiagContextThreadData().

◆ GetDefaultClientIP()

string CDiagContext::GetDefaultClientIP ( void  )
static

Get default client ip.

The ip may be set using SetDefaultClientIP(), NCBI_LOG_CLIENT_IP env. variable or Log.Client_Ip value in the INI file.

Definition at line 2932 of file ncbidiag.cpp.

References s_DefaultClientIp.

Referenced by CRequestContext::GetClientIP(), CRequestContext::IsSetClientIP(), and CDiagContext::x_StartRequest().

◆ GetDefaultHitID()

string CDiagContext::GetDefaultHitID ( void  ) const

Get global default hit id.

The hit id may be set using SetDefaultHitId(), HTTP_NCBI_PHID or NCBI_LOG_HIT_ID env. variables, or Log.Http_Hit_Id/Log.Hit_Id values in the INI file. The Http-value has higher priority. If none of the values is set, the default hit id is generated automatically.

Definition at line 1748 of file ncbidiag.cpp.

References CDiagContext::eHitID_Create, CSharedHitId::GetHitId(), and CDiagContext::x_GetDefaultHitID().

◆ GetDefaultSessionID()

string CDiagContext::GetDefaultSessionID ( void  ) const

Get default session id.

The session id may be set using SetDefaultSessionId(), NCBI_LOG_SESSION_ID env. variable or Log.Session_Id value in the INI file.

Definition at line 868 of file logging.cpp.

References kEmptyStr.

Referenced by CDiagContext::GetSessionID(), CRequestContext::GetSessionID(), and CRequestContext::IsSetSessionID().

◆ GetDescription()

bool CDiagErrCodeInfo::GetDescription ( const ErrCode err_code,
SDiagErrCodeDescription description 
) const

Get description for specified error code.

Get description message for the error by its code.

Returns
TRUE if error description exists for this code; return FALSE otherwise.

Definition at line 8323 of file ncbidiag.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), and CDiagErrCodeInfo::m_Info.

◆ GetDiagContext()

CDiagContext& GetDiagContext ( void  )

Get diag context instance.

Definition at line 818 of file logging.cpp.

References ctx, CSafeStaticLifeSpan::eLifeSpan_Long, and CSafeStatic< T, Callbacks >::Get().

Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), CNcbiApplicationAPI::AppMain(), CCgiApplication::AppStart(), CNcbiApplicationAPI::AppStart(), CCgiApplication::AppStop(), CNcbiApplicationAPI::AppStop(), CNcbiTestsObserver::assertion_result(), CGRPCServerCallbacks::BeginRequest(), CWNJobWatcher::CheckForInfiniteLoop(), CCgi2RCgiApp::CheckJob(), CVcfTrack::CheckRange(), CNSClientsRegistry::ClearOnTimeout(), CGridCommandLineInterfaceApp::Cmd_Login(), CNcbiApplicationAPI::CNcbiApplicationAPI(), CompressAssembly(), ColumnarVcfCache::CreateBlob(), CreateErrorRequestContext(), CRequestContext_PassThrough::CRequestContext_PassThrough(), CRequestContextGuard_Base::CRequestContextGuard_Base(), DismissErrorRequestContext(), CGRPCServerCallbacks::EndRequest(), CRemoteAppLauncher::ExecRemoteApp(), NAutomation::CAutomationProc::ExecSetContext(), SAsyncWriteTask::Execute(), CNetScheduleServer::Exit(), CDiagContext_Extra::Flush(), CNcbiApplicationAPI::FlushDiag(), g_PostPerf(), CBlastAligner::GenerateAlignments(), SDiagMessage::GetAppName(), SDiagMessage::GetAppState(), CRequestContext::GetAppState(), CRequestContext::GetClientIP(), GetDiagRequestId(), CRequestContext::GetEncodedSessionID(), SDiagMessage::GetHost(), SDiagMessage::GetSession(), CRequestContext::GetSessionID(), SDiagMessage::GetUID(), CAsyncWriteCache::GetWriteStream(), SNetScheduleAPIImpl::Init(), CTLibContext::InitApplicationName(), CRequestContext::IsSetClientIP(), CRequestContext::IsSetHitID(), CRequestContext::IsSetSessionID(), CNcbiLogFields::LogFields(), CCgiApplication::LogRequest(), main(), Main(), NcbiSys_main(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), CPerfLogger::Post(), CStatisticsCounters::PrintServerWide(), CQueue::PrintStatistics(), CGetStatisticsProcessor::Process(), CCgiSampleApplication::ProcessPrintEnvironment(), COperationTiming::Register(), CRequestContextGuard_Base::Release(), CNetStorageGCDatabase::RemoveObject(), CIgBlast::Run(), CCgiApplication::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), CNetStorageGCApp::Run(), CExec::RunSilent(), CAdvancedAlignCleanup::RunSplignOnCompartment(), s_Daemonize(), s_GetNextLogPrefix(), s_GetOtherArgs(), s_SpawnUnix(), CSparseGraph::Save(), SetDiagHandler(), SetDiagRequestId(), SetDiagUserAndHost(), CSharedHitId::SetHitId(), CRequestContext::SetHitID(), ColumnarVcfCache::SetInfoFields(), CCgiResponse::SetMultipartMode(), CNcbiApplicationAPI::SetProgramDisplayName(), CRequestContext::SetSessionID(), CGridCommandLineInterfaceApp::SetUp_NetStorageCmd(), CDiagContext::SetupDiag(), CExec::SpawnL(), CExec::SpawnLE(), CExec::SpawnLP(), CExec::SpawnLPE(), CExec::SpawnV(), CExec::SpawnVE(), CExec::SpawnVP(), CExec::SpawnVPE(), CLogLatencyReport::Start(), CCgi2RCgiApp::SubmitJob(), CDiagContext::sx_ThreadDataTlsCleanup(), UncomressAndCreate(), CDiagContext::UpdatePID_AsyncSafe(), CCgiResponse::WriteHeader(), CNgAligner::x_Align_Impl(), CQueue::x_CancelJobs(), CQueue::x_CheckExecutionTimeout(), CSparseGraph::x_CheckRemoteData(), CQueueDataBase::x_CreateAndMountQueue(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CPubseqGatewayApp::x_CreateRequestContext(), CPubseqGatewayApp::x_DispatchRequest(), CGetJobNotificationThread::x_DoJob(), CJobQueueCleanerThread::x_DoJob(), CJobQueueExecutionWatcherThread::x_DoJob(), CSGAlignStatJob::x_Execute(), CNetStorageHandler::x_GetConnRef(), CNetScheduleHandler::x_GetConnRef(), CRequestContext::x_GetHitID(), CNetStorageHandler::x_GetObject(), CException::x_Init(), SDiagMessage::x_InitData(), CCgiContext::x_InitSession(), SDiagMessage::x_IsSetOldFormat(), CNetScheduleHandler::x_LogCommandWithJob(), CDBConnectionFactory::x_LogConnection(), CDiagContext::x_LogEnvironment(), CRequestContext::x_LogHitID(), CNcbiApplicationAPI::x_LogOptions(), CQueue::x_LogSubmit(), CHttpConnection::x_MaintainBacklog(), SDiagMessage::x_NewWrite(), CCgiApplication::x_OnEvent(), CQueueDataBase::x_Open(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetScheduleHandler::x_PrintCmdRequestStop(), CNetStorageGCApp::x_PrintFinishCounters(), CNetScheduleHandler::x_PrintGetJobResponse(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetStorageHandler::x_PrintMessageRequestStop(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), CPubseqGatewayApp::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessChangeAffinity(), CNetScheduleHandler::x_ProcessClearWorkerNode(), CNetStorageHandler::x_ProcessCreate(), CNetScheduleHandler::x_ProcessGetJob(), CNetScheduleHandler::x_ProcessJobExchange(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessReading(), CNetStorageHandler::x_ProcessReconfigure(), CNetScheduleHandler::x_ProcessReloadConfig(), CNetStorageHandler::x_ProcessRelocate(), CNetScheduleHandler::x_ProcessSetAffinity(), CNetScheduleHandler::x_ProcessSetQueue(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), CNetStorageGCApp::x_RemoveObjects(), CInstancedAligner::x_RunAligner(), CFastCgiApplicationMT::x_RunFastCGI(), SWorkerNodeJobContextImpl::x_RunJob(), SOfflineJobContextImpl::x_RunJob(), SDiagMessage::x_SaveContextData(), CId2ReaderBase::x_SetContextData(), CSparseGraph::x_Sync(), CNcbiApplicationAPI::x_TryMain(), CRequestContext::x_UpdateSubHitID(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().

◆ GetDiagDieLevel()

EDiagSev GetDiagDieLevel ( void  )

Get the "die" (abort) level for the program.

Definition at line 6211 of file ncbidiag.cpp.

Referenced by CAsyncDiagHandler::Post().

◆ GetDiagErrCodeInfo()

CDiagErrCodeInfo* GetDiagErrCodeInfo ( bool  take_ownership = false)

Get handler for processing error codes.

Definition at line 7659 of file ncbidiag.cpp.

References _ASSERT, and CDiagLock::eRead.

Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ GetDiagFilter()

string GetDiagFilter ( EDiagFilter  what)

Get current diagnostic filter.

Parameters
whatFilter is set for, only eDiagFilter_Trace and eDiagFilter_Post values are allowed, otherwise the function returns empty string.
See also
SetDiagFilter

Definition at line 7681 of file ncbidiag.cpp.

References eDiagFilter_Post, eDiagFilter_Trace, CDiagLock::eWrite, kEmptyStr, s_PostFilter, and s_TraceFilter.

Referenced by CCdregionValidator::x_ValidateCDSPeptides().

◆ GetDiagHandler()

CDiagHandler* GetDiagHandler ( bool  take_ownership = false,
bool current_ownership = 0 
)

◆ GetDiagPostLevel()

EDiagSev GetDiagPostLevel ( void  )

Get current threshold severity for posting the messages.

Returns
Return current post-level.
See also
SetDiagPostLevel()

Definition at line 6151 of file ncbidiag.cpp.

Referenced by CPubseqGatewayApp::Init(), CPubseqGatewayApp::ParseArgs(), and CRPCClient_Base::x_Ask().

◆ GetDiagRequestId()

Uint8 GetDiagRequestId ( void  )

Get iteration number/request ID.

Definition at line 1195 of file ncbidiag.cpp.

References GetDiagContext(), CDiagContext::GetRequestContext(), and CRequestContext::GetRequestID().

Referenced by GetFastCGIIteration().

◆ GetDiagStream()

CNcbiOstream* GetDiagStream ( void  )

Get current diagnostic stream (if it was set by SetDiagStream) or NULL.

Definition at line 8108 of file ncbidiag.cpp.

References eDiagFile_Err, GetDiagHandler(), CFileDiagHandler::GetLogStream(), and CStreamDiagHandler_Base::GetStream().

◆ GetDiagTrace()

bool GetDiagTrace ( void  )

Check if traces are enabled.

Definition at line 6240 of file ncbidiag.cpp.

Referenced by CPubseqGatewayApp::Init().

◆ GetDtab()

const string & CRequestContext::GetDtab ( void  ) const
inline

◆ GetElapsedTime()

double CPerfLogger::GetElapsedTime ( void  ) const
inline

◆ GetEncodedAppName()

const string & CDiagContext::GetEncodedAppName ( void  ) const

Get URL-encoded application name.

Definition at line 1875 of file ncbidiag.cpp.

References CDiagContext::GetAppName(), CDiagContext::m_AppName, and CDiagContext::m_AppNameSet.

Referenced by SDiagMessage::GetAppName(), and SDiagMessage::x_SaveContextData().

◆ GetEncodedHost()

const string & CDiagContext::GetEncodedHost ( void  ) const

URL-encoded version of GetHost()

Definition at line 1812 of file ncbidiag.cpp.

References CDiagContext::GetHost(), CDiagContext::m_Host, and CDiagContext::m_HostIP.

Referenced by SDiagMessage::GetHost(), and SDiagMessage::x_SaveContextData().

◆ GetEncodedHostname()

const string & CDiagContext::GetEncodedHostname ( void  ) const

Get URL-encoded hostname.

Definition at line 1832 of file ncbidiag.cpp.

References CDiagContext::m_Host.

◆ GetEncodedSessionID() [1/2]

string CDiagContext::GetEncodedSessionID ( void  ) const

Get url-encoded session id.

Definition at line 874 of file logging.cpp.

References kEmptyStr.

Referenced by CRequestContext::GetEncodedSessionID(), SDiagMessage::GetSession(), and SDiagMessage::x_SaveContextData().

◆ GetEncodedSessionID() [2/2]

string CRequestContext::GetEncodedSessionID ( void  ) const
inline

◆ GetErrCodeString()

const char * CRequestContextException::GetErrCodeString ( void  ) const
overridevirtual

Translate from the error code value to its string representation.

Definition at line 891 of file request_ctx.cpp.

References CRequestContextException::eBadHit, CRequestContextException::eBadSession, and CException::GetErrCodeString().

◆ GetErrorCode()

int CNcbiDiag::GetErrorCode ( void  ) const

Get error code of the current message.

Referenced by CDiagFilter::Check().

◆ GetErrorSubCode()

int CNcbiDiag::GetErrorSubCode ( void  ) const

Get error subcode of the current message.

Referenced by CDiagFilter::Check().

◆ GetEventName()

string SDiagMessage::GetEventName ( EEventType  event)
static

◆ GetExitCode()

int CDiagContext::GetExitCode ( void  ) const
inline

Get exit code.

Definition at line 2174 of file ncbidiag.hpp.

References CDiagContext::m_ExitCode.

Referenced by CDiagContext::x_PrintMessage().

◆ GetExitSignal()

int CDiagContext::GetExitSignal ( void  ) const
inline

Get exit signal.

Definition at line 2183 of file ncbidiag.hpp.

References CDiagContext::m_ExitSig.

Referenced by CDiagContext::x_PrintMessage().

◆ GetFastCGIIteration()

Uint8 GetFastCGIIteration ( void  )
inline

Definition at line 1410 of file ncbidiag.hpp.

References GetDiagRequestId().

◆ GetFile() [1/2]

const char* CDiagCompileInfo::GetFile ( void  ) const

◆ GetFile() [2/2]

const char* CNcbiDiag::GetFile ( void  ) const

Get file used for the current message.

Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().

◆ GetFunction() [1/2]

const string& CDiagCompileInfo::GetFunction ( void  ) const

◆ GetFunction() [2/2]

const char* CNcbiDiag::GetFunction ( void  ) const

Get function name of the current message.

Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().

◆ GetGlobalAppState()

EDiagAppState CDiagContext::GetGlobalAppState ( void  ) const

Always returns global application state.

Definition at line 2796 of file ncbidiag.cpp.

References CDiagContext::m_AppState.

Referenced by CRequestContext::GetAppState().

◆ GetGlobalRequestId()

string CDiagContext::GetGlobalRequestId ( void  ) const
inline

Deprecated version of HID generator.

Definition at line 1997 of file ncbidiag.hpp.

References CDiagContext::GetNextHitID().

◆ GetHitId()

const string& CSharedHitId::GetHitId ( void  ) const
inline

◆ GetHitID()

string CRequestContext::GetHitID ( void  ) const
inline

Get explicit hit id or the default one (from HTTP_NCBI_PHID etc).

If none of the above is available, generate a new id for the current request. If using the default hit id, it is cached in the request context and becomes local one.

Definition at line 227 of file request_ctx.hpp.

References CDiagContext::eHitID_Create, and CRequestContext::x_GetHitID().

Referenced by g_PostPerf(), CHTMLPageStat::PrintBegin(), s_UpdateVDBRequestContext(), CCgiApplication::x_OnEvent(), and CRequestContext::x_UpdateSubHitID().

◆ GetHost() [1/2]

const string & SDiagMessage::GetHost ( void  ) const

◆ GetHost() [2/2]

const string & CDiagContext::GetHost ( void  ) const

Get host name.

The order is: cached hostname, cached hostIP, uname or COMPUTERNAME, SERVER_ADDR, empty string.

Definition at line 1766 of file ncbidiag.cpp.

References _T_STDSTRING, _TX, buf, CDiagContext::m_Host, CDiagContext::m_HostIP, and NcbiSys_getenv.

Referenced by CDiagContext::GetEncodedHost(), SNetScheduleAPIImpl::Init(), CJaegerTracer::OnRequestStart(), CGridCommandLineInterfaceApp::SetUp_NetStorageCmd(), and CDiagContext::x_CreateUID().

◆ GetHostIP()

const string& CDiagContext::GetHostIP ( void  ) const
inline

Get host IP address.

Definition at line 2160 of file ncbidiag.hpp.

References CDiagContext::m_HostIP.

Referenced by CDiagContext::GetProperty().

◆ GetHostLocation()

const string & CDiagContext::GetHostLocation ( void  )
static

Get host location (be-md/st-va) from /etc/ncbi/location.

Definition at line 3111 of file ncbidiag.cpp.

References _T_CSTRING, _TX, CDiagLock::eWrite, NcbiSys_getenv, s_HostLocation, s_ReadString(), and string.

Referenced by CDiagContext_Extra::PrintNcbiRoleAndLocation().

◆ GetHostname()

const string & CDiagContext::GetHostname ( void  ) const

Get cached hostname - do not try to detect host name as GetHost() does.

Definition at line 1826 of file ncbidiag.cpp.

References CDiagContext::m_Host.

Referenced by CDiagContext::GetProperty().

◆ GetHostRole()

const string & CDiagContext::GetHostRole ( void  )
static

◆ GetLine() [1/2]

int CDiagCompileInfo::GetLine ( void  ) const

◆ GetLine() [2/2]

size_t CNcbiDiag::GetLine ( void  ) const

Get line number for the current message.

Referenced by SThreadsInSTBuild::Report().

◆ GetLogFile() [1/3]

string GetLogFile ( EDiagFileType  file_type)

Get log file name for the given log type.

Return empty string for eDiagFile_All or if the log file handler is not installed.

Definition at line 7612 of file ncbidiag.cpp.

References file_type, GetDiagHandler(), CFileDiagHandler::GetLogFile(), CStreamDiagHandler_Base::GetLogName(), and kEmptyStr.

Referenced by CProjBulderApp::Init(), and CDiagContext::IsUsingRootLog().

◆ GetLogFile() [2/3]

string CFileDiagHandler::GetLogFile ( EDiagFileType  file_type) const

Get current log file name.

If file_type is eDiagFile_All, always returns empty string.

Definition at line 6975 of file ncbidiag.cpp.

References eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, file_type, CStreamDiagHandler_Base::GetLogName(), kEmptyStr, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_Perf, and CFileDiagHandler::m_Trace.

Referenced by GetLogFile().

◆ GetLogFile() [3/3]

string GetLogFile ( void  )

Get log file name or diag handler name.

Definition at line 7629 of file ncbidiag.cpp.

References GetDiagHandler(), and kEmptyStr.

◆ GetLogger()

CPerfLogger& CPerfLogGuard::GetLogger ( void  )
inline

Access logger directly.

Definition at line 331 of file perf_log.hpp.

References CPerfLogGuard::m_Logger.

◆ GetLoggerStartTime()

const CTime& CPerfLogger::GetLoggerStartTime ( void  ) const
inline

Get the logger's start time.

Definition at line 166 of file perf_log.hpp.

References CPerfLogger::m_FirstStartTime.

◆ GetLogName() [1/4]

string CDiagHandler::GetLogName ( void  )
virtual

◆ GetLogName() [2/4]

string CStreamDiagHandler_Base::GetLogName ( void  )
virtual

Get current diag posts destination.

Reimplemented from CDiagHandler.

Definition at line 6408 of file ncbidiag.cpp.

References CStreamDiagHandler_Base::m_LogName.

Referenced by GetLogFile(), CFileDiagHandler::GetLogFile(), and CFileHandleDiagHandler::Reopen().

◆ GetLogName() [3/4]

string CAsyncDiagHandler::GetLogName ( void  )
virtual

Get current diag posts destination.

Reimplemented from CDiagHandler.

Definition at line 7255 of file ncbidiag.cpp.

References CDiagHandler::GetLogName(), CAsyncDiagHandler::m_AsyncThread, and CAsyncDiagThread::m_SubHandler.

◆ GetLogName() [4/4]

string CSysLog::GetLogName ( void  )
inlinevirtual

Get current diag posts destination.

Reimplemented from CDiagHandler.

Definition at line 111 of file syslog.hpp.

References CSysLog::kLogName_Syslog.

◆ GetLogRate_Limit()

unsigned int CDiagContext::GetLogRate_Limit ( ELogRate_Type  type) const

◆ GetLogRate_Period()

unsigned int CDiagContext::GetLogRate_Period ( ELogRate_Type  type) const

◆ GetLogStream()

CNcbiOstream * CFileDiagHandler::GetLogStream ( EDiagFileType  file_type)

Get current log stream.

Return NULL if the selected destination is not a stream.

Definition at line 6993 of file ncbidiag.cpp.

References eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, file_type, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_Perf, and CFileDiagHandler::m_Trace.

Referenced by GetDiagStream().

◆ GetLogTruncate()

bool CDiagContext::GetLogTruncate ( void  )
static

Get log file truncation flag.

Definition at line 3469 of file ncbidiag.cpp.

Referenced by CFileHandleDiagHandler::CFileHandleDiagHandler(), and CDiagContext::SetupDiag().

◆ GetModule() [1/2]

const char* CDiagCompileInfo::GetModule ( void  ) const

◆ GetModule() [2/2]

const char* CNcbiDiag::GetModule ( void  ) const

Get module name of the current message.

Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().

◆ GetNextHitID()

string CDiagContext::GetNextHitID ( void  ) const

Create global unique request id.

Definition at line 1715 of file ncbidiag.cpp.

References CDiagContext::x_GetNextHitID().

Referenced by CDiagContext::GetGlobalRequestId().

◆ GetNextRequestID()

CRequestContext::TCount CRequestContext::GetNextRequestID ( void  )
static

Return the next available application-wide request ID.

Definition at line 190 of file request_ctx.cpp.

References CAtomicCounter::Add().

Referenced by s_AddLogPrefix(), and CRequestContext::SetRequestID().

◆ GetNextSubHitID()

const string & CRequestContext::GetNextSubHitID ( CTempString  prefix = CTempString())
inline

◆ GetNextSubHitId()

TSubHitId CSharedHitId::GetNextSubHitId ( void  )
inline

Get next sub-hit id value.

Definition at line 111 of file request_ctx.hpp.

References CSharedHitId::IsShared(), CSharedHitId::m_SharedSubHitId, and CSharedHitId::m_SubHitId.

Referenced by CRequestContext::x_UpdateSubHitID().

◆ GetOmitStackTrace()

bool CNcbiDiag::GetOmitStackTrace ( void  ) const
inline

Definition at line 1199 of file ncbidiag.hpp.

References CNcbiDiag::m_OmitStackTrace.

◆ GetPID()

CDiagContext::TPID CDiagContext::GetPID ( void  )
static

◆ GetPostFlags()

TDiagPostFlags CNcbiDiag::GetPostFlags ( void  ) const

Get post flags for the current message.

If the post flags have "eDPF_Default" set, then in the returned flags it will be reset and substituted by current default flags.

Referenced by SThreadsInSTBuild::Report(), and CNcbiDiag::x_Put().

◆ GetPrintSeverity()

EDiagSev CDiagCollectGuard::GetPrintSeverity ( void  ) const
inline

Get current print severity.

Definition at line 1343 of file ncbidiag.hpp.

References CDiagCollectGuard::m_PrintSev.

Referenced by CDiagCollectGuard::x_Init(), and CNcbiDiag::x_Put().

◆ GetProcessPostNumber()

CDiagContext::TCount CDiagContext::GetProcessPostNumber ( EPostNumberIncrement  inc)
static

Return process post number (incrementing depends on the flag).

Definition at line 3848 of file ncbidiag.cpp.

References CAtomicCounter::Add(), ePostNumber_Increment, and CAtomicCounter::Get().

Referenced by SDiagMessage::SDiagMessage(), and SetDiagHandler().

◆ GetProperties() [1/2]

TProperties& CRequestContext::GetProperties ( void  )
inline

Get all properties (non-const)

Definition at line 301 of file request_ctx.hpp.

References CRequestContext::m_Properties.

◆ GetProperties() [2/2]

const TProperties& CRequestContext::GetProperties ( void  ) const
inline

Get all properties (read only)

Definition at line 299 of file request_ctx.hpp.

References CRequestContext::m_Properties.

◆ GetProperty() [1/2]

const string & CRequestContext::GetProperty ( const string name) const

Get property value or empty string.

Definition at line 295 of file request_ctx.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), kEmptyStr, and CRequestContext::m_Properties.

Referenced by s_GetNextLogPrefix(), and s_GetReferer().

◆ GetProperty() [2/2]

string CDiagContext::GetProperty ( const string name,
EPropertyMode  mode = eProp_Default 
) const

◆ GetReadOnly()

bool CRequestContext::GetReadOnly ( void  ) const
inline

Get current read-only flag.

Definition at line 374 of file request_ctx.hpp.

References CRequestContext::m_IsReadOnly.

Referenced by CDiagContextThreadData::SetRequestContext().

◆ GetRef()

const CNcbiDiag& CNcbiDiag::GetRef ( void  ) const
inline

Some compilers (e.g.

GCC 3.4.0) fail to use temporary objects as function arguments if there's no public copy constructor. Rather than using the temporary, get a reference from this method.

Definition at line 946 of file ncbidiag.hpp.

Referenced by CArrayHolder::Convert(), CMessageHandlerDiagPost::HandleMessage(), CMessageHandlerThrowOnError::HandleMessage(), CMessageListenerWithLog::PutError(), ReportIncorrectOrder(), ReportUnsafeStaticType(), and s_TraceParams().

◆ GetRequestContext() [1/2]

CRequestContext& CRequestContextGuard_Base::GetRequestContext ( void  ) const
inline

Get the guarded request context.

Definition at line 598 of file request_ctx.hpp.

References CRequestContextGuard_Base::m_RequestContext.

◆ GetRequestContext() [2/2]

CRequestContext & CDiagContext::GetRequestContext ( void  )
static

Shortcut to CDiagContextThreadData::GetThreadData().GetRequestContext()

Definition at line 1901 of file ncbidiag.cpp.

References CDiagContextThreadData::GetRequestContext(), and CDiagContextThreadData::GetThreadData().

Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), SNetScheduleSubmitterImpl::AppendClientIPSessionIDHitID(), SNetCacheAPIImpl::AppendClientIPSessionIDHitID(), SNetCacheAPIImpl::AppendClientIPSessionIDPasswordAgeHitID(), CNcbiTestsObserver::assertion_result(), SNSCommandArguments::AssignValues(), CGRPCServerCallbacks::BeginRequest(), NAutomation::CAutomationProc::ExecSetContext(), g_AppendClientIPSessionIDHitID(), g_PostPerf(), CDiagContext::GetAppState(), SDiagMessage::GetClient(), CPSG_Request::GetCtx(), GetDiagRequestId(), CDiagContext::GetProperty(), CDiagContext::GetSessionID(), CAsyncWriteCache::GetWriteStream(), SErrorEmulatorParameter::IsActive(), main(), SNetStorageRPC::MkStdRequest(), CCgiRequestProcessor::OnException(), CHTMLPageStat::PrintBegin(), CDiagContext::PrintStop(), CCgiApplication::ProcessHttpReferer(), SPSG_IoSession::ProcessRequest(), CCgiContext::RetrieveTrackingId(), SGridWorkerNodeImpl::Run(), CThread::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), s_GetNextLogPrefix(), s_GetReferer(), s_GetRequestDTab(), s_GetRequestID(), s_UpdateVDBRequestContext(), CGraphCache< TData >::SaveData(), CDiagContext::SetAppState(), SetDiagRequestId(), CCgiApplication::SetHTTPStatus(), CCgiRequestProcessor::SetHTTPStatus(), CDiagContext::SetProperty(), CPSGS_Request::SetRequestContext(), SetSessionAndIPAndPHID(), CCgiResponse::SetStatus(), CNetCacheAdmin::ShutdownServer(), SInteractiveNewRequestStart::SInteractiveNewRequestStart(), CCgiResponse::WriteHeader(), CCgiRequest::x_InitRequestContext(), CCgiContext::x_InitSession(), CNetScheduleHandler::x_LogCommandWithJob(), CNetScheduleHandler::x_OnCmdParserError(), CCgiApplication::x_OnEvent(), CNetScheduleHandler::x_PrintCmdRequestStart(), CDiagContext::x_PrintMessage(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), CNetStorageGCApp::x_RemoveObjects(), SDiagMessage::x_SaveContextData(), CCgiRequest::x_SetClientIpProperty(), CId2ReaderBase::x_SetContextData(), and CDiagContext::x_StartRequest().

◆ GetRequestID()

CRequestContext::TCount CRequestContext::GetRequestID ( void  ) const
inline

◆ GetRequestStatus()

int CRequestContext::GetRequestStatus ( void  ) const
inline

◆ GetRequestTimer() [1/2]

CStopWatch& CRequestContext::GetRequestTimer ( void  )
inline

Definition at line 269 of file request_ctx.hpp.

References CRequestContext::m_ReqTimer.

◆ GetRequestTimer() [2/2]

const CStopWatch& CRequestContext::GetRequestTimer ( void  ) const
inline

◆ GetSession()

string SDiagMessage::GetSession ( void  ) const

◆ GetSessionID() [1/2]

string CDiagContext::GetSessionID ( void  ) const

Get the effective session id: the per-request session id if set, or the default session id.

Definition at line 2903 of file ncbidiag.cpp.

References CDiagContext::GetDefaultSessionID(), CDiagContext::GetRequestContext(), CRequestContext::GetSessionID(), and CRequestContext::IsSetExplicitSessionID().

Referenced by CDiagContext::GetProperty().

◆ GetSessionID() [2/2]

string CRequestContext::GetSessionID ( void  ) const
inline

◆ GetSeverity()

EDiagSev CNcbiDiag::GetSeverity ( void  ) const

Get severity of the current message.

Referenced by CDiagFilter::Check(), CNcbiDiag::CheckFilters(), and CNcbiDiag::x_Put().

◆ GetSeverityCap()

EDiagSev CDiagCollectGuard::GetSeverityCap ( void  ) const
inline

Get current severity cap for use in ePrintCapped mode.

Definition at line 1355 of file ncbidiag.hpp.

References CDiagCollectGuard::m_SeverityCap.

Referenced by CDiagContextThreadData::RemoveCollectGuard().

◆ GetSpan()

jaegertracing::Span& CJaegerTracerSpan::GetSpan ( void  )
inline

Definition at line 58 of file jaeger_tracer.hpp.

References CJaegerTracerSpan::m_Span.

Referenced by CJaegerTracer::OnRequestStop().

◆ GetSplitLogFile()

bool GetSplitLogFile ( void  )

Get split log files flag.

Definition at line 6711 of file ncbidiag.cpp.

References s_SplitLogFile.

◆ GetStartingPoint()

Uint8 CDiagCollectGuard::GetStartingPoint ( void  ) const
inline

Get the lowest thread-local post number in this guard's scope.

Definition at line 1365 of file ncbidiag.hpp.

References CDiagCollectGuard::m_StartingPoint.

Referenced by CDiagContextThreadData::RemoveCollectGuard().

◆ GetStdStatusMessage()

string CRequestStatus::GetStdStatusMessage ( ECode  code)
static

Definition at line 45 of file request_status.cpp.

References CRequestStatus::e100_Continue, CRequestStatus::e101_SwitchingProtocols, CRequestStatus::e200_Ok, CRequestStatus::e201_Created, CRequestStatus::e202_Accepted, CRequestStatus::e203_NonAuthInformation, CRequestStatus::e204_NoContent, CRequestStatus::e205_ResetContent, CRequestStatus::e206_PartialContent, CRequestStatus::e299_PartialContentBrokenConnection, CRequestStatus::e300_MultipleChoices, CRequestStatus::e301_MovedPermanently, CRequestStatus::e302_Found, CRequestStatus::e303_SeeOther, CRequestStatus::e304_NotModified, CRequestStatus::e305_UseProxy, CRequestStatus::e307_TemporaryRedirect, CRequestStatus::e400_BadRequest, CRequestStatus::e401_Unauthorized, CRequestStatus::e402_PaymentRequired, CRequestStatus::e403_Forbidden, CRequestStatus::e404_NotFound, CRequestStatus::e405_MethodNotAllowed, CRequestStatus::e406_NotAcceptable, CRequestStatus::e407_ProxyAuthRequired, CRequestStatus::e408_RequestTimeout, CRequestStatus::e409_Conflict, CRequestStatus::e410_Gone, CRequestStatus::e411_LengthRequired, CRequestStatus::e412_PreconditionFailed, CRequestStatus::e413_RequestEntityTooLarge, CRequestStatus::e414_RequestURITooLong, CRequestStatus::e415_UnsupportedMediaType, CRequestStatus::e416_RangeNotSatisfiable, CRequestStatus::e417_ExpectationFailed, CRequestStatus::e422_UnprocessableEntity, CRequestStatus::e451_Unavailable_For_Legal_Reasons, CRequestStatus::e499_BrokenConnection, CRequestStatus::e500_InternalServerError, CRequestStatus::e501_NotImplemented, CRequestStatus::e502_BadGateway, CRequestStatus::e503_ServiceUnavailable, CRequestStatus::e504_GatewayTimeout, and CRequestStatus::e505_HTTPVerNotSupported.

Referenced by g_AsGRPCStatus(), CCgiException::GetStdStatusMessage(), and SPSG_IoSession::OnHeader().

◆ GetStream() [1/2]

virtual CNcbiOstream* CStreamDiagHandler_Base::GetStream ( void  )
inlinevirtual

Reimplemented in CStreamDiagHandler.

Definition at line 2579 of file ncbidiag.hpp.

Referenced by GetDiagStream(), and IsDiagStream().

◆ GetStream() [2/2]

virtual CNcbiOstream* CStreamDiagHandler::GetStream ( void  )
inlinevirtual

Reimplemented from CStreamDiagHandler_Base.

Definition at line 2612 of file ncbidiag.hpp.

References CStreamDiagHandler::m_Stream.

Referenced by CNcbiApplicationAPI::AppMain().

◆ GetStringUID() [1/3]

void CDiagContext::GetStringUID ( TUID  uid,
char *  buf 
) const
Deprecated:
Use GetStringUID(TUID, char*, size_t) instead.

Definition at line 1685 of file ncbidiag.cpp.

References buf, and CDiagContext::GetStringUID().

◆ GetStringUID() [2/3]

void CDiagContext::GetStringUID ( TUID  uid,
char *  buf,
size_t  buf_len 
) const

Fill buffer with string representation of UID.

The buffer size must be at least 17 bytes.

Definition at line 1676 of file ncbidiag.cpp.

References _ASSERT, buf, and int.

◆ GetStringUID() [3/3]

string CDiagContext::GetStringUID ( TUID  uid = 0) const

◆ GetThreadPostNumber()

CDiagContext::TCount CDiagContext::GetThreadPostNumber ( EPostNumberIncrement  inc)
static

Return thread post number (incrementing depends on the flag).

Definition at line 3856 of file ncbidiag.cpp.

References CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::GetThreadPostNumber().

Referenced by CDiagCollectGuard::x_Init().

◆ GetTID()

CDiagContext::TTID CDiagContext::GetTID ( void  )
static

◆ GetTime()

CTime SDiagMessage::GetTime ( void  ) const

Get time and date - current or parsed.

Definition at line 5341 of file ncbidiag.cpp.

References SDiagMessage::m_Data, SDiagMessageData::m_Time, and s_GetFastTime().

Referenced by CwxLogDiagHandler::Post(), and CDiagContext::WriteStdPrefix().

◆ GetTracerSpan()

shared_ptr<ITracerSpan> CRequestContext::GetTracerSpan ( void  )
inline

Definition at line 387 of file request_ctx.hpp.

References CRequestContext::m_TracerSpan.

◆ GetUID() [1/2]

CDiagContext::TUID SDiagMessage::GetUID ( void  ) const

Get UID from current context or parsed from a string.

Definition at line 5335 of file ncbidiag.cpp.

References GetDiagContext(), CDiagContext::GetUID(), SDiagMessage::m_Data, and SDiagMessageData::m_UID.

Referenced by CDiagContext::WriteStdPrefix().

◆ GetUID() [2/2]

CDiagContext::TUID CDiagContext::GetUID ( void  ) const

◆ GetUsername()

const string & CDiagContext::GetUsername ( void  ) const

◆ GetVersion()

TVersion CRequestContext::GetVersion ( void  ) const
inline

Return version increased on every context change (hit/subhit id, client ip, session id).

Definition at line 380 of file request_ctx.hpp.

References CRequestContext::m_Version.

Referenced by s_UpdateVDBRequestContext().

◆ HaveDescription()

bool CDiagErrCodeInfo::HaveDescription ( const ErrCode err_code) const

Check if error description exists.

Return TRUE if description for specified error code exists, otherwise return FALSE.

◆ HonorRegistrySettings()

void CSysLog::HonorRegistrySettings ( const IRegistry reg = 0)

◆ IgnoreDiagDieLevel()

bool IgnoreDiagDieLevel ( bool  ignore)

Ignore the die level settings.

Return previous setting.

WARNING!!! – not recommended for use unless you are real desperate: By passing TRUE to this function you can make your application never exit/abort regardless of the level set by SetDiagDieLevel(). But be warned this is usually a VERY BAD thing to do! – because any library code counts on at least "eDiag_Fatal" to exit unconditionally, and thus what happens once "eDiag_Fatal" has been posted, is, in general, totally unpredictable! Therefore, use it on your own risk.

Definition at line 6217 of file ncbidiag.cpp.

References CDiagLock::eWrite.

◆ InitMessages()

void CDiagContext::InitMessages ( size_t  max_size = 100)

Start collecting all messages (the collected messages can be flushed to a new destination later).

Stop collecting messages when max_size is reached.

Definition at line 3370 of file ncbidiag.cpp.

References CDiagContext::m_MaxMessages, and CDiagContext::m_Messages.

Referenced by CNcbiApplicationAPI::CNcbiApplicationAPI().

◆ InstallToDiag()

void CAsyncDiagHandler::InstallToDiag ( void  )

Install this DiagHandler into diagnostics.

Method should be called only when diagnostics is completely initialized, i.e. no earlier than CNcbiApplication::Run() is called. Method can throw CThreadException if dedicated thread failed to start.

Deprecated:
Use regular diganostics instead.

Definition at line 7225 of file ncbidiag.cpp.

References CObject::AddReference(), GetDiagHandler(), CAsyncDiagHandler::m_AsyncThread, CAsyncDiagThread::m_SubHandler, CAsyncDiagHandler::m_ThreadSuffix, NULL, CObject::RemoveReference(), CThread::Run(), and SetDiagHandler().

◆ IsApplogSeverityLocked()

static bool CDiagContext::IsApplogSeverityLocked ( void  )
inlinestatic

When using applog, the diag post level is locked to Warning.

The following functions allow to access the lock, but should not be used by most applications.

Definition at line 2296 of file ncbidiag.hpp.

References CDiagContext::sm_ApplogSeverityLocked.

Referenced by AdjustApplogPrintableSeverity(), CDiagRestorer::CDiagRestorer(), and s_GetFastTime().

◆ IsCollectingMessages()

bool CDiagContext::IsCollectingMessages ( void  ) const
inline

Check if message collecting is on.

Definition at line 2243 of file ncbidiag.hpp.

References CDiagContext::m_Messages.

◆ IsDiagStream()

bool IsDiagStream ( const CNcbiOstream os)

Definition at line 7636 of file ncbidiag.cpp.

References CStreamDiagHandler_Base::GetStream().

◆ IsMainThreadDataInitialized()

bool CDiagContext::IsMainThreadDataInitialized ( void  )
static

Definition at line 912 of file ncbidiag.cpp.

References eInitialized, CThread::IsMain(), and s_ThreadDataState().

◆ IsON()

bool CPerfLogger::IsON ( void  )
static

Is performance logging on, globally? Controlled by CParam(section="Log", entry="PerfLogging", default=false)

Definition at line 58 of file perf_log.cpp.

Referenced by CLogPerformance::CLogPerformance(), g_DoErasePerfLogging(), g_DoPerfLogging(), CPerfLogger::Post(), CPerfLogGuard::Post(), CPerfLogger::Start(), CPerfLogger::Suspend(), and CPerfLogger::~CPerfLogger().

◆ IsRequestLevel()

bool CSharedHitId::IsRequestLevel ( void  ) const
inline

Check if this hit ID was set at request level.

Definition at line 117 of file request_ctx.hpp.

References eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, and CSharedHitId::m_AppState.

Referenced by CRequestContext::IsSetHitID().

◆ IsRunning()

bool CRequestContext::IsRunning ( void  ) const
inlineprivate

Definition at line 406 of file request_ctx.hpp.

References CRequestContext::m_IsRunning.

◆ IsSet()

bool CRequestContext_PassThrough::IsSet ( CTempString  name) const
inline

◆ IsSetBytesRd()

bool CRequestContext::IsSetBytesRd ( void  ) const
inline

◆ IsSetBytesWr()

bool CRequestContext::IsSetBytesWr ( void  ) const
inline

◆ IsSetClientIP()

bool CRequestContext::IsSetClientIP ( void  ) const
inline

◆ IsSetDiagErrCodeInfo()

bool IsSetDiagErrCodeInfo ( )

Indicates whether an error-code processing handler has been set.

Definition at line 7654 of file ncbidiag.cpp.

Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ IsSetDiagHandler()

bool IsSetDiagHandler ( void  )

Check if diagnostic handler is set.

Returns
Return TRUE if user has ever set (or unset) diag. handler.

Definition at line 6324 of file ncbidiag.cpp.

References s_DefaultHandler.

◆ IsSetDiagPostFlag()

bool IsSetDiagPostFlag ( EDiagPostFlag  flag,
TDiagPostFlags  flags = eDPF_Default 
)
inline

Check if a specified flag is set.

Parameters
flagFlag to check
flagsIf eDPF_Default is set for "flags" then use the current global flags on its place (merged with other flags from "flags").
Returns
"TRUE" if the specified "flag" is set in global "flags" that describes the post settings.
See also
SetDiagPostFlag(), UnsetDiagPostFlag()

Referenced by CDiagContext::ApproveMessage(), CNcbiDiag::ForceImportantFlags(), CFileDiagHandler::x_GetDiagFileType(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ IsSetDtab()

bool CRequestContext::IsSetDtab ( void  ) const
inline

◆ IsSetExitCode()

bool CDiagContext::IsSetExitCode ( void  ) const
inline

Check if exit code has been set.

Definition at line 2172 of file ncbidiag.hpp.

References CDiagContext::m_ExitCodeSet.

Referenced by CNcbiApplicationAPI::AppMain().

◆ IsSetExplicitClientIP()

bool CRequestContext::IsSetExplicitClientIP ( void  ) const
inline

◆ IsSetExplicitHitID()

bool CRequestContext::IsSetExplicitHitID ( void  ) const
inline

Check if there's an explicit hit id.

Deprecated:
Use IsSetHitID(eHitID_Request) instead.

Definition at line 242 of file request_ctx.hpp.

References CRequestContext::eHitID_Request, and CRequestContext::IsSetHitID().

◆ IsSetExplicitSessionID()

bool CRequestContext::IsSetExplicitSessionID ( void  ) const
inline

Does not check default SID.

Definition at line 729 of file request_ctx.hpp.

References CRequestContext::eProp_SessionID, and CRequestContext::x_IsSetProp().

Referenced by CDiagContext::GetSessionID(), and CRequestContext::IsSetSessionID().

◆ IsSetHitID()

bool CRequestContext::IsSetHitID ( EHitIDSource  src = eHitID_Any) const
inline

Check if there's an explicit hit id or the default one.

Parameters
srcAllowed source(s) of hit id.
Returns
If 'src' is eHitID_Any, always return 'true' because GetHitID always returns a non-empty value. For other options return true if the selected hit id source is already not empty.

Definition at line 745 of file request_ctx.hpp.

References CRequestContext::eHitID_Any, CRequestContext::eHitID_Default, CRequestContext::eHitID_Request, CRequestContext::eProp_HitID, GetDiagContext(), CSharedHitId::IsRequestLevel(), CRequestContext::m_HitID, and CRequestContext::x_IsSetProp().

Referenced by g_PostPerf(), CRequestContext::IsSetExplicitHitID(), s_UpdateVDBRequestContext(), COSGFetch::SetContext(), CCgiRequest::x_InitRequestContext(), CId2ReaderBase::x_SetContextData(), CRequestContext::x_UpdateStdPassThroughProp(), and CRequestContext::x_UpdateSubHitID().

◆ IsSetOldPostFormat()

bool CDiagContext::IsSetOldPostFormat ( void  )
static

◆ IsSetProperty()

bool CRequestContext::IsSetProperty ( const string name) const

Check if the property has a value (even if it's an empty string).

Definition at line 302 of file request_ctx.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), and CRequestContext::m_Properties.

Referenced by CCgiRequest::x_InitRequestContext().

◆ IsSetRequestID()

bool CRequestContext::IsSetRequestID ( void  ) const
inline

Check if request ID was assigned a value.

Definition at line 657 of file request_ctx.hpp.

References CRequestContext::eProp_RequestID, and CRequestContext::x_IsSetProp().

◆ IsSetRequestStatus()

bool CRequestContext::IsSetRequestStatus ( void  ) const
inline

◆ IsSetSessionID()

bool CRequestContext::IsSetSessionID ( void  ) const
inline

◆ IsShared()

bool CSharedHitId::IsShared ( void  ) const
inline

Check if shared counter is used.

Definition at line 88 of file request_ctx.hpp.

References CSharedHitId::m_SharedSubHitId.

Referenced by CSharedHitId::GetCurrentSubHitId(), CSharedHitId::GetNextSubHitId(), and CSharedHitId::SetShared().

◆ IsUsingRootLog()

bool CDiagContext::IsUsingRootLog ( void  )
static

Check if the current diagnostics destination is /log/*.

Definition at line 3868 of file ncbidiag.cpp.

References GetLogFile(), and kRootLog.

◆ IsUsingSystemThreadId()

bool CDiagContext::IsUsingSystemThreadId ( void  )
static

Check if system TID is printed instead of CThread::GetSelf()

Definition at line 3358 of file ncbidiag.cpp.

References s_PrintSystemTID.

◆ IsValidSessionID()

bool CRequestContext::IsValidSessionID ( const string session_id)
static

◆ IsVisibleDiagPostLevel()

bool IsVisibleDiagPostLevel ( EDiagSev  sev)

Check if the specified severity is higher or equal to the currently selected post level and will be printed by ERR_POST.

Definition at line 6166 of file ncbidiag.cpp.

References AdjustApplogPrintableSeverity(), CompareDiagPostLevel(), and eDiag_Trace.

Referenced by CDiagHandler::PostToConsole(), and s_LOG_Handler().

◆ LogFields()

template<class TEntries >
void CNcbiLogFields::LogFields ( const TEntries &  entries) const
inline

Log (as an extra) all names/values matching fields in NCBI_LOG_FIELDS.

If source passed to the constructor is not empty, all names are prefixed with 'source.' string.

Definition at line 2408 of file ncbidiag.hpp.

References entries, CDiagContext::Extra(), GetDiagContext(), and CNcbiLogFields::x_Match().

Referenced by CGRPCServerCallbacks::BeginRequest(), and CHttpRequest::PrintLogFields().

◆ MDiagClass()

MDiagClass::MDiagClass ( const char *  nclass)

◆ MDiagFunction()

MDiagFunction::MDiagFunction ( const char *  function)

◆ MDiagModule()

MDiagModule::MDiagModule ( const char *  module)

◆ NCBI_EXCEPTION_DEFAULT()

CRequestContextException::NCBI_EXCEPTION_DEFAULT ( CRequestContextException  ,
CException   
)

◆ NcbiLog_AppGetHitID()

char* NcbiLog_AppGetHitID ( void  )

Get hit ID (HID, a.k.a.

PHID) for the whole application.

Returns
  • copy of the current application-wide (P)HID (URL-encoded);
  • NULL on error.
Attention
This function should be called after NcbiLog_AppRun().
The caller is responsible for freeing the returned string! Use free() or NcbiLog_FreeMemory().
See also
NcbiLog_AppSetHitID, NcbiLog_AppRun

Definition at line 3114 of file ncbi_c_log.c.

References eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, SInfo_tag::phid, s_StrDup(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.

◆ NcbiLog_AppGetSession()

char* NcbiLog_AppGetSession ( void  )

Get session ID (SID) for the whole application.

Returns
  • copy of the current application-wide SID (URL-encoded);
  • NULL, if SID is unknown, not set yet, or on error.
Attention
This function should be called after NcbiLog_AppRun().
The caller is responsible for freeing the returned string! Use free() or NcbiLog_FreeMemory().
See also
NcbiLog_AppSetSession, NcbiLog_AppStart, NcbiLog_FreeMemory

Definition at line 2968 of file ncbi_c_log.c.

References eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, s_StrDup(), SInfo_tag::session, SInfo_tag::state, sx_Info, and TROUBLE_MSG.

◆ NcbiLog_AppNewHitID()

void NcbiLog_AppNewHitID ( void  )
Deprecated:
This method do nothing and will be removed later.

Definition at line 3101 of file ncbi_c_log.c.

◆ NcbiLog_AppNewSession()

void NcbiLog_AppNewSession ( void  )

Auto-generate and then set brand-new application-wide session ID (SID).

See also
NcbiLog_AppSetSession

Definition at line 3020 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, NCBILOG_SESSION_MAX, s_GenerateSID_Str(), s_SetSession(), SInfo_tag::session, and sx_Info.

◆ NcbiLog_AppRun()

void NcbiLog_AppRun ( void  )

Should be called after the application is initialized and before its main part.

It changes the application state shown in the log to 'P' and log app-wide extra information, if any.

See also
NcbiLog_AppStart, NcbiLog_AppStop

Definition at line 3367 of file ncbi_c_log.c.

References CHECK_APP_START, ctx, eNcbiLog_AppRun, SInfo_tag::host_location, SInfo_tag::host_role, i, SNcbiLog_Param::key, MT_LOCK_API, MT_UNLOCK, NcbiLog_GetHostLocation(), NcbiLog_GetHostRole(), NULL, SInfo_tag::phid, SInfo_tag::remote_logging, s_AddParamsPair(), s_Extra(), s_GetContext(), s_SetState(), sx_Info, SNcbiLog_Param::value, and VERIFY.

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_AppSetClient()

void NcbiLog_AppSetClient ( const char *  client)

Set client for the whole application.

This setting is effective in between requests, and for the requests for which the client was not explicitly set (by calling NcbiLog_SetClient()).

By default, this value is taken from the environment variables. If that is not populated, it is set to 'UNK_CLIENT'.

Parameters
clientNew client name (IP address). It will be set to 'UNK_CLIENT' if parameter is NULL or empty string.
See also
NcbiLog_SetClient

Definition at line 2941 of file ncbi_c_log.c.

References client, SInfo_tag::client, MT_LOCK_API, MT_UNLOCK, s_SetClient(), and sx_Info.

◆ NcbiLog_AppSetHitID()

void NcbiLog_AppSetHitID ( const char *  hit_id)

Set hit ID (HID, a.k.a.

PHID) for the whole application.

This setting is effective in between of requests, and for the requests for which the (P)HID was not explicitly set by calling NcbiLog_SetHitID().

By default, (P)HID is taken from the HTTP_NCBI_PHID environment variable; if that is not set, then from NCBI_LOG_HIT_ID environment variable; if that is not set also – not used at all until any of *SetHitID() calls.

Attention
This function should be called before NcbiLog_AppRun(), because if PHID is not set on application level or in the environment, then new PHID will be generated on NcbiLog_AppRun().
Parameters
hit_idNew (P)HID. (It will be URL-encoded.) (P)HID will be unset if the parameter is NULL or point to empty string, and PHID has not been logged yet.
See also
NcbiLog_AppRun, NcbiLog_SetHitID, NcbiLog_AppGetHitID, NcbiLog_GetNextSubHitID

Definition at line 3064 of file ncbi_c_log.c.

References eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, SInfo_tag::phid, SInfo_tag::phid_inherit, s_SetHitID(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.

◆ NcbiLog_AppSetSession()

void NcbiLog_AppSetSession ( const char *  session)

Set session ID (SID) for the whole application.

This setting is effective in between requests, and for the requests for which the client was not explicitly set (by calling either NcbiLog_SetSession() or NcbiLog_NewSession()).

By default, SID is taken from the HTTP_NCBI_SID environment variable; if that is not set, then – from NCBI_LOG_SESSION_ID environment variable; if that is not set, then – SID is set to 'UNK_SESSION'.

Parameters
sessionNew session ID. (It will be URL-encoded.) It will be set to 'UNK_SESSION' if the parameter is NULL or empty string.
See also
NcbiLog_AppNewSession, NcbiLog_SetSession, NcbiLog_NewSession

Definition at line 2960 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, s_SetSession(), SInfo_tag::session, and sx_Info.

Referenced by CNcbiApplogApp::SetInfo().

◆ NcbiLog_AppStart()

void NcbiLog_AppStart ( const char *  argv[])

Should be called as soon as possible during application initialization.

Writes the 'start' line to the <appname>.log, including the command line. Calling this function early ensures that the start time of the application is recorded; that data is later used by NcbiLog_AppStop() to calculate the application runtime duration. If not called explicitly, NcbiLog_AppStart() is called by most other functions (but application arguments will not be logged in this case).

Parameters
argcThe count of arguments that follow in argv (from main()).
argvAn array of null-terminated strings representing command-line arguments of the program (from main()).
See also
NcbiLog_AppRun, NcbiLog_AppStop

Definition at line 3357 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_AppStart(), and s_GetContext().

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_AppStop()

void NcbiLog_AppStop ( int  exit_status)

Should be called immediately prior to the application exit.

Logs the 'stop' line to the <appname>.log files. Calculates the application runtime duration based on a start time recorded when the application starts up.

See also
NcbiLog_AppStart, NcbiLog_AppStopSignal

Definition at line 3400 of file ncbi_c_log.c.

References NcbiLogP_AppStop().

Referenced by main().

◆ NcbiLog_AppStopSignal()

void NcbiLog_AppStopSignal ( int  exit_status,
int  exit_signal 
)

The same as NcbiLog_AppStop(), except it also accepts a signal number, if application exited due to a signal.

See also
NcbiLog_AppStart, NcbiLog_AppStop

Definition at line 3406 of file ncbi_c_log.c.

References NcbiLogP_AppStop().

◆ NcbiLog_Context_Attach()

int NcbiLog_Context_Attach ( TNcbiLog_Context  ctx)

Attach logging context object to the C Logging API.

Note
You should call this method before logging or using any other methods that change context information. All API methods work with attached context only, otherwise you can get unexpected results.
Parameters
ctxA handle previously obtained from NcbiLog_Context_Create().
Returns
Non-zero value if the requested operation was successful. Also, return zero value if some other context is already attached.
See also
NcbiLog_Context_Create, NcbiLog_Context_Attach, NcbiLog_Context_Destroy

Definition at line 2655 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, and s_AttachContext().

◆ NcbiLog_Context_Create()

TNcbiLog_Context NcbiLog_Context_Create ( void  )

Create new thread-specific logging context object.

These context-specific methods to create, attach, detach and destroy thread-specific logging context objects allow to separate context from the API, store it somewhere else and use when necessary, even from different threads. Because the API initialization can be done in background, it is impossible to pass application name used in each logging message, so it will be "UNKNOWN" by default. But, you can call NcbiLog_Init() or NcbiLog_InitForAttachedContext(), or one of its variants. Or, you can hard-code application name on the compilation step, using "-D NCBI_C_LOG_APPNAME=appname" in the compiler's command line for this API.

Note
You should call this method first, before using any other API methods.
Created context have a thread id of the thread that created it. Thread id can be changed if necessary using NcbiLog_SetThreadId() after attaching context to the API.
Default MT locking implementation will be used in MT configurations, you cannot use your own MT-handler with this type on initialization.
Also, please read NcbiLog_Init() and comments at the beginning of this file.
Returns
Handle to newly created context object or NULL on error.
See also
NcbiLog_Context_Attach, NcbiLog_Context_Detach, NcbiLog_Context_Destroy, NcbiLog_ForAttachedContext

Definition at line 2644 of file ncbi_c_log.c.

References ctx, NcbiLog_InitForAttachedContext(), NULL, and s_CreateContext().

◆ NcbiLog_Context_Destroy()

void NcbiLog_Context_Destroy ( TNcbiLog_Context  ctx)

Destroy context structure.

Note
NcbiLog_Context_Detach() should be called before context destroying.
Parameters
ctxA handle previously obtained from NcbiLog_Context_Create().
See also
NcbiLog_Context_Create, NcbiLog_Context_Attach, NcbiLog_Context_Detach

Definition at line 2681 of file ncbi_c_log.c.

References assert, ctx, and free().

◆ NcbiLog_Context_Detach()

void NcbiLog_Context_Detach ( void  )

Detach logging context object from the C Logging API.

Note
The C Logging API cannot be used without any context attached.
Returns
Non-zero value if the requested operation was successful.
See also
NcbiLog_Context_Create, NcbiLog_Context_Attach, NcbiLog_Context_Destroy

Definition at line 2668 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, NULL, s_TlsSetValue(), sx_ContextST, and sx_TlsIsInit.

◆ NcbiLog_Critical()

void NcbiLog_Critical ( const char *  msg)

Writes a message to the <appname>.err log at level 'CRITICAL'.

See also
NcbiLog_SetPostLevel

Definition at line 3846 of file ncbi_c_log.c.

References eNcbiLog_Critical, and s_PrintMessage().

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_Default_MTLock_Handler()

int NcbiLog_Default_MTLock_Handler ( void *  user_data,
ENcbiLog_MTLock_Action  action 
)

Default implementation of simple MT locking callback.

Parameters
user_dataSimple default handler don't use this parameter; will be ignored.
actionOperation that should be done in the callback handler.
Returns
Non-zero value if the requested operation was successful.
See also
FNcbiLog_MTLock_Handler, NcbiLog_MTLock_Create

Definition at line 255 of file ncbi_c_log.c.

Referenced by NcbiLog_InitMT().

◆ NcbiLog_Destroy()

void NcbiLog_Destroy ( void  )

Destroy NcbiLog API.

This function should be called last. After it any other API's calls will be ignored. For MT applications see also NcbiLog_Destroy_Thread().

See also
NcbiLog_Init, NcbiLog_InitForAttachedContext

Definition at line 2602 of file ncbi_c_log.c.

References SInfo_tag::app_base_name, SInfo_tag::app_full_name, CLOSE_CLEANUP, free(), SInfo_tag::message, MT_LOCK, NcbiLog_MTLock_Delete(), NULL, s_CloseLogFiles(), s_DestroyContext(), s_TlsDestroy(), sx_Info, sx_IsEnabled, sx_IsInit, sx_MTLock, sx_MTLock_Own, and sx_TlsIsInit.

Referenced by CNcbiApplogApp::Cmd_Health(), main(), and CNcbiApplogApp::Run().

◆ NcbiLog_Destroy_Thread()

void NcbiLog_Destroy_Thread ( void  )

Destroy thread-specific NcbiLog API information.

Each thread should call this function before termination, and before NcbiLog_Destroy() call. Calling any other API function in the current thread except NcbiLog_Destroy() is prohibited and can lead to application crash.

Note
Not necessary to call this function in single-threaded applications if NcbiLog_InitST() was used.
See also
NcbiLog_Init, NcbiLog_InitST, NcbiLog_Destroy

Definition at line 2594 of file ncbi_c_log.c.

References MT_LOCK, MT_UNLOCK, and s_DestroyContext().

◆ NcbiLog_Error()

void NcbiLog_Error ( const char *  msg)

Writes a message to the <appname>.err log at level 'ERROR'.

See also
NcbiLog_SetPostLevel

Definition at line 3841 of file ncbi_c_log.c.

References eNcbiLog_Error, and s_PrintMessage().

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_Extra()

void NcbiLog_Extra ( const SNcbiLog_Param params)

Can be called at any time.

Writes the 'extra' line to the <appname>.log file. Can take a pointer to NULL-terminated array with parameters, as key/value pairs; that data will be logged. Appropriate for logging thing such as HTTP referrer information and cookie values. Should NOT be used for executing tracing or logging of debugging info – see the NcbiLog_Trace function for those purposes.

Definition at line 3716 of file ncbi_c_log.c.

References CHECK_APP_START, ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_Extra(), and s_GetContext().

Referenced by main().

◆ NcbiLog_Fatal()

void NcbiLog_Fatal ( const char *  msg)

Writes a message to the <appname>.err log at level 'FATAL' and then terminate the application.

See also
NcbiLog_SetPostLevel

Definition at line 3851 of file ncbi_c_log.c.

References eNcbiLog_Fatal, and s_PrintMessage().

◆ NcbiLog_FreeMemory()

void NcbiLog_FreeMemory ( void *  ptr)

Free memory allocated inside the C logging API.

Can be useful when using from JAVA/Python wrappers, that cannot deallocate memory directly.

Parameters
ptrPointer to allocated memory.
See also
NcbiLog_GetNextSubHitID

Definition at line 3264 of file ncbi_c_log.c.

References free().

◆ NcbiLog_GetCurrentSubHitID()

char* NcbiLog_GetCurrentSubHitID ( void  )

Definition at line 3212 of file ncbi_c_log.c.

References NcbiLog_GetCurrentSubHitID_Prefix(), and NULL.

◆ NcbiLog_GetCurrentSubHitID_Prefix()

char* NcbiLog_GetCurrentSubHitID_Prefix ( const char *  prefix)

Get the last generated sub-hit ID.

Parameters
prefixPrefix for generated sub-hit ID string. Empty if NULL.
Returns
Last generated sub-hit ID. if NcbiLog_GetNextSubHitID() has never been called, it returns subhit with the current value of the counter, which is zero.
Attention
This function should be called after NcbiLog_AppRun().
The caller is responsible for freeing the returned sub-hit ID string! Use free() or NcbiLog_FreeMemory().
See also
NcbiLog_AppSetHitID, NcbiLog_SetHitID, NcbiLog_FreeMemory, NcbiLog_GetNextSubHitID

Definition at line 3218 of file ncbi_c_log.c.

References ctx, eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, prefix, s_GetContext(), s_GetSubHitID(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.

Referenced by NcbiLog_GetCurrentSubHitID().

◆ NcbiLog_GetHitID()

char* NcbiLog_GetHitID ( void  )

Get hit ID (HID, a.k.a.

PHID) for the request.

Returns
  • copy of the current request (P)HID (URL-encoded);
  • if not set, copy of the application-wide (P)HID;
  • NULL, if called outside request, or on error.
Attention
This function should be called inside request, after NcbiLog_ReqRun().
The caller is responsible for freeing the returned string! Use free() or NcbiLog_FreeMemory().
See also
NcbiLog_AppSetHitID, NcbiLog_SetHitID, NcbiLog_ReqRun

Definition at line 3132 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NULL, SInfo_tag::phid, SInfo_tag::phid_inherit, s_GetContext(), s_IsInsideRequest(), s_StrDup(), and sx_Info.

◆ NcbiLog_GetHostLocation()

const char* NcbiLog_GetHostLocation ( void  )

Get host location.

If $NCBI_LOCATION environment variable is defined, use its value. Otherwise, read it from /etc/ncbi/location

Get host location.

Definition at line 648 of file ncbi_c_log.c.

References location, NULL, s_ReadFileString(), and s_StrDup().

Referenced by NcbiLog_AppRun(), CNcbiApplogApp::Redirect(), and s_PrintReqStartExtraParams().

◆ NcbiLog_GetHostName()

const char* NcbiLog_GetHostName ( void  )

Get host name.

If $NCBI_HOST environment variable is defined, use its value. Otherwise, try to detect host name.

The order is: cached host name, $NCBI_HOST, uname() or COMPUTERNAME, empty string.

Definition at line 573 of file ncbi_c_log.c.

References buf, NULL, and s_StrDup().

Referenced by CNcbiApplogApp::Redirect(), CNcbiApplogApp::Run(), s_CreateUID(), and s_PrintCommonPrefix().

◆ NcbiLog_GetHostRole()

const char* NcbiLog_GetHostRole ( void  )

Get host role.

If $NCBI_ROLE environment variable is defined, use its value. Otherwise, read it from /etc/ncbi/role.

Get host role.

Definition at line 630 of file ncbi_c_log.c.

References NULL, s_ReadFileString(), and s_StrDup().

Referenced by NcbiLog_AppRun(), CNcbiApplogApp::Redirect(), and s_PrintReqStartExtraParams().

◆ NcbiLog_GetNextSubHitID()

char* NcbiLog_GetNextSubHitID ( void  )

Definition at line 3238 of file ncbi_c_log.c.

References NcbiLog_GetNextSubHitID_Prefix(), and NULL.

◆ NcbiLog_GetNextSubHitID_Prefix()

char* NcbiLog_GetNextSubHitID_Prefix ( const char *  prefix)

Generate a sub-hit ID based on the currently effective (whether it's request-specific or application-wide) hit ID.

Parameters
prefixPrefix for generated sub-hit ID string. Empty if NULL.
Returns
Generated sub-hit ID.
Attention
This function should be called after NcbiLog_AppRun().
The caller is responsible for freeing the returned sub-hit ID string! Use free() or NcbiLog_FreeMemory().
See also
NcbiLog_AppSetHitID, NcbiLog_SetHitID, NcbiLog_FreeMemory, NcbiLog_GetCurrentSubHitID

Definition at line 3244 of file ncbi_c_log.c.

References ctx, eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, prefix, s_GetContext(), s_GetSubHitID(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.

Referenced by NcbiLog_GetNextSubHitID().

◆ NcbiLog_GetRequestId()

TNcbiLog_Counter NcbiLog_GetRequestId ( void  )

Get current request ID (RID).

See also
NcbiLog_SetRequestId, NcbiLog_ReqStart

Definition at line 2913 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, SInfo_tag::rid, and sx_Info.

◆ NcbiLog_GetSession()

char* NcbiLog_GetSession ( void  )

Get sessio ID (SID) for the request.

Returns
  • copy of the current request SID (URL-encoded);
  • if not set, copy of the application-wide SID;
  • NULL, if called outside request, or on error.
Attention
This function should be called inside request, after NcbiLog_ReqRun().
The caller is responsible for freeing the returned string! Use free() or NcbiLog_FreeMemory().
See also
NcbiLog_AppGetSession, NcbiLog_ReqRun, NcbiLog_FreeMemory

Definition at line 2987 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), s_IsInsideRequest(), s_StrDup(), SInfo_tag::session, and sx_Info.

◆ NcbiLog_GetState()

ENcbiLog_AppState NcbiLog_GetState ( void  )

Get current logging execution state (context and thread specific).

See also
ENcbiLog_AppState

Definition at line 3283 of file ncbi_c_log.c.

References ctx, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), SInfo_tag::state, sx_Info, and sx_IsInit.

◆ NcbiLog_Info()

void NcbiLog_Info ( const char *  msg)

Writes a message to the <appname>.trace file at level 'INFO'.

Note that the default log level is ERROR.

See also
NcbiLog_SetPostLevel

Definition at line 3831 of file ncbi_c_log.c.

References eNcbiLog_Info, and s_PrintMessage().

Referenced by CNcbiApplogApp::Run().

◆ NcbiLog_Init()

void NcbiLog_Init ( const char *  appname,
TNcbiLog_MTLock  mt_lock,
ENcbiLog_MTLock_Ownership  mt_lock_ownership 
)

Initializing NcbiLog API.

This function should be called before any other API's function. Only first call of NcbiLog_Init() have effect. All subsequent calls will be ignored. Preferable, in MT applications it should be called before creating any child thread uses logging.

Parameters
appnameSet the application name shown in logs and used for logfile names. By default the name is unknown. The application name can be set only once at API initialization (using NcbiLog_Init() call). This name could include path and extension, only base name will be used to show in logs. Also, any spaces contained in the base file name will be URL-encoded. Also, the application name can be hard-coded on the compilation step, using "-D NCBI_C_LOG_APPNAME=appname" in the compiler's command line for this API. Hard-coded name have a priority over the passed parameter.
mt_lockUser defined MT lock. It is necessary to use NcbiLog API in multi-threaded applications.
own_mt_lockMT lock ownership flag. If eNcbiLog_MT_TakeOwnership is passed, then the MT lock handler will be destroyed in NcbiLog_Destroy().
Note
It is recommended to call NcbiLog_InitST() instead of NcbiLog_Init[MT]() if you don't use logging simultaneously from some threads.
See also
NcbiLog_InitMT, NcbiLog_InitST, NcbiLog_Destroy, NcbiLog_MTLock_Create, NcbiLog_Context_Create
Note
Sometimes, simplified logging initialization can be used. For details please see NcbiLog_Context_Create() description and comments at the beginning of this file.

Definition at line 2520 of file ncbi_c_log.c.

References eNcbiLog_MT_TakeOwnership, MT_INIT, MT_LOCK, MT_UNLOCK, s_Init(), sx_IsInit, sx_MTLock, sx_MTLock_Own, and VERIFY.

Referenced by main(), NcbiLog_InitMT(), and NcbiLog_InitST().

◆ NcbiLog_InitForAttachedContext()

void NcbiLog_InitForAttachedContext ( const char *  appname)

Version of NcbiLog_Init to use with NcbiLog_Context_* functions only.

This function should be called before any other API's function. Only first call of NcbiLog_InitForAttachedContext() have effect. All subsequent calls will be ignored. You can skip it if you don't wish to set up an application name for logging, all initialization will be done in background.

Note
Default MT locking implementation will be used, you cannot use your own locking using with this type on initialization.
For details please see NcbiLog_Context_Create() description and comments at the beginning of this file.
Parameters
appnameSet the application name shown in logs and used for logfile names. By default the name is unknown. The application name can be set only once at API initialization. This name could include path and extension, only base name will be used to show in logs. Also, any spaces contained in the base file name will be URL-encoded. Also, the application name can be hard-coded on the compilation step, using "-D NCBI_C_LOG_APPNAME=appname" in the compiler's command line for this API. Hard-coded name have a priority over passed parameter.
See also
NcbiLog_Init, NcbiLog_InitForAttachedContextST, NcbiLog_Context_Create

Definition at line 2560 of file ncbi_c_log.c.

References MT_INIT, MT_LOCK, MT_UNLOCK, s_Init(), and sx_IsInit.

Referenced by NcbiLog_Context_Create().

◆ NcbiLog_InitForAttachedContextST()

void NcbiLog_InitForAttachedContextST ( const char *  appname)

Version of NcbiLog_InitForAttachedContext() intended to use in single-threaded applications.

Use it if you use API from single thread only, it can be a little bit faster than NcbiLog_InitForAttachedContext() because don't use MT-safety.

See also
NcbiLog_InitForAttachedContext, NcbiLog_Init, NcbiLog_InitST, NcbiLog_Context_Create

Definition at line 2588 of file ncbi_c_log.c.

References NcbiLog_InitST().

◆ NcbiLog_InitMT()

void NcbiLog_InitMT ( const char *  appname)

Version of NcbiLog_Init with default MT lock implementation.

This function should be called before any other API's function. Preferable, in MT applications it should be called before creating any child thread uses logging.

See also
NcbiLog_Init, NcbiLog_InitST

Definition at line 2547 of file ncbi_c_log.c.

References eNcbiLog_MT_TakeOwnership, NcbiLog_Default_MTLock_Handler(), NcbiLog_Init(), NcbiLog_MTLock_Create(), and NULL.

Referenced by main().

◆ NcbiLog_InitST()

void NcbiLog_InitST ( const char *  appname)

Version of NcbiLog_Init to use in single-threaded applications.

This function should be called before any other API's function.

Note
You can call NcbiLog_InitST() instead of NcbiLog_Init[MT]() in MT applications also if you don't use logging from some threads simultaneously. This will turn off API's MT-safety.
See also
NcbiLog_Init, NcbiLog_InitMT

Definition at line 2554 of file ncbi_c_log.c.

References eNcbiLog_MT_NoOwnership, NcbiLog_Init(), and NULL.

Referenced by CNcbiApplogApp::Cmd_Health(), NcbiLog_InitForAttachedContextST(), and CNcbiApplogApp::Run().

◆ NcbiLog_MTLock_Create()

TNcbiLog_MTLock NcbiLog_MTLock_Create ( void *  user_data,
FNcbiLog_MTLock_Handler  handler 
)

Create new MT lock.

Parameters
user_dataUnspecified data to call "handler" with. Could be used to have the same handler for some different MT locks. The 'user_data' allow to distinguish each lock and adjust behavior accordingly.
handlerLocking callback
Returns
Handle to newly created MT lock object or NULL on error.
See also
NcbiLog_MTLock_Delete, FNcbiLog_MTLock_Handler

Definition at line 347 of file ncbi_c_log.c.

References TNcbiLog_MTLock_tag::handler, kMTLock_magic_number, TNcbiLog_MTLock_tag::magic_number, malloc(), and TNcbiLog_MTLock_tag::user_data.

Referenced by main(), and NcbiLog_InitMT().

◆ NcbiLog_MTLock_Delete()

void NcbiLog_MTLock_Delete ( TNcbiLog_MTLock  lock)

Call cleanup action on the handler, then destroy it.

Parameters
lockA handle previously obtained from NcbiLog_MTLock_Create().
See also
NcbiLog_MTLock_Create, FNcbiLog_MTLock_Handler

Definition at line 363 of file ncbi_c_log.c.

References free(), TNcbiLog_MTLock_tag::magic_number, MT_DESTROY, MT_LOCK_VALID, and NULL.

Referenced by NcbiLog_Destroy().

◆ NcbiLog_NewHitID()

void NcbiLog_NewHitID ( void  )
Deprecated:
This method do nothing and will be removed later.

Definition at line 3108 of file ncbi_c_log.c.

◆ NcbiLog_NewSession()

void NcbiLog_NewSession ( void  )

Auto-generate and then set brand-new session ID (SID) for the request.

See also
NcbiLog_SetSession

Definition at line 3029 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NCBILOG_SESSION_MAX, NULL, s_GenerateSID_Str(), s_GetContext(), and s_SetSession().

◆ NcbiLog_Note()

void NcbiLog_Note ( ENcbiLog_Severity  sev,
const char *  msg 
)

Writes a message using "Note[X]" notation for severity.

Behavior is identical to NcbiLog_XXX() function for each severity.

See also
NcbiLog_SetPostLevel,

Definition at line 3856 of file ncbi_c_log.c.

References s_PrintMessage().

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_Perf()

void NcbiLog_Perf ( int  status,
double  timespan,
const SNcbiLog_Param params 
)

Can be called at any time.

Writes the 'perf' line to the <appname>.log file. Used to log a performance information. Takes status code of some operation, its execution time and a pointer to NULL-terminated array with parameters, as key/value pairs.

Definition at line 3738 of file ncbi_c_log.c.

References buf, CATCH, CHECK_APP_START, ctx, eDiag_Perf, SInfo_tag::message, MT_LOCK_API, MT_UNLOCK, NCBILOG_ENTRY_MAX, NULL, SInfo_tag::phid, s_GetContext(), s_IsInsideRequest(), s_Post(), s_PrintCommonPrefix(), s_PrintParams(), s_PrintParamsPair(), sx_Info, and VERIFY_CATCH.

Referenced by main().

◆ NcbiLog_ReqRun()

void NcbiLog_ReqRun ( void  )

Should be called once request processing initialization is complete.

It changes the application state shown in the log to 'R' and log request-specific extra information, if any.

See also
NcbiLog_ReqStart, NcbiLog_ReqStop

Definition at line 3602 of file ncbi_c_log.c.

References CHECK_APP_START, ctx, eNcbiLog_Request, MT_LOCK_API, MT_UNLOCK, NCBILOG_HITID_MAX, NULL, SInfo_tag::phid, SInfo_tag::phid_inherit, s_GenerateHitID_Str(), s_GetContext(), s_LogHitID(), s_SetHitID(), s_SetState(), and sx_Info.

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_ReqStart()

void NcbiLog_ReqStart ( const SNcbiLog_Param params)

Should be called once application startup is complete, before any request processing code is run.

Writes the 'request-start' line to the <appname>.log file. Sets or resets the start time of the current request; that data is later used by NcbiLog_ReqStop() to calculate the request runtime duration. Can optionally be passed a pointer to NULL-terminated array with parameters, as key/value pairs; that data will be logged. This method also resets the client and session information. If the user has provided alternate info, it may be overridden as a side-effect of calling this method. Automatically increase request id number.

See also
NcbiLog_SetRequestId, NcbiLog_ReqStop

Definition at line 3546 of file ncbi_c_log.c.

References CATCH, ctx, eDiag_Log, SNcbiLog_Param::key, SInfo_tag::message, MT_LOCK_API, MT_UNLOCK, NCBILOG_ENTRY_MAX, NULL, prev(), s_GetContext(), s_Post(), s_PrintParams(), s_PrintReqStartExtraParams(), s_ReqStart(), sx_Info, and VERIFY_CATCH.

Referenced by main().

◆ NcbiLog_ReqStop()

void NcbiLog_ReqStop ( int  status,
size_t  bytes_rd,
size_t  bytes_wr 
)

Should be called once request processing is complete.

Writes the 'request-stop' line to the <appname>.log file. Calculates request runtime duration based on a start time recorded when NcbiLog_ReqStart() is called. Session and client information is reset to UNK_SESSION and UNK_CLIENT.

See also
NcbiLog_ReqStart

Definition at line 3638 of file ncbi_c_log.c.

References CATCH, CHECK_APP_START, ctx, eDiag_Log, eNcbiLog_AppRun, eNcbiLog_RequestEnd, SInfo_tag::message, MT_LOCK_API, MT_UNLOCK, NULL, SInfo_tag::post_time, s_DiffTime(), s_GetContext(), s_Post(), s_PrintCommonPrefix(), s_SetState(), sx_Info, and VERIFY_CATCH.

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_SetClient()

void NcbiLog_SetClient ( const char *  client)

Set client for the request.

This setting is effective for a single request:

If the client is not explicitly set for a request, this value is taken from the environment variables. If that is not populated, then the application wide value (see NcbiLog_AppSetClient()) will be used for the request.

Attention
NcbiLog_ReqStop() resets the client back to the application-wide value!
Parameters
clientNew client name (IP address). It will be set to 'UNK_CLIENT' if parameter is NULL or empty string.
See also
NcbiLog_AppSetClient, NcbiLog_ReqStart, NcbiLog_ReqStop

Definition at line 2949 of file ncbi_c_log.c.

References client, ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), and s_SetClient().

Referenced by main(), and CNcbiApplogApp::SetInfo().

◆ NcbiLog_SetDestination()

ENcbiLog_Destination NcbiLog_SetDestination ( ENcbiLog_Destination  ds)

Set up diagnostics destination.

Parameters
dsAn enum value to specify an application's diagnostics destination.
Returns
The diagnostic destination that was really set. It is not always possible to set up an destination for logging messages that specified in parameters and fallback can be used. See ENcbiLog_Destination description for details. Sets to eNcbiLog_Disable in the case of critical errors.
Note
If destination is set to eNcbiLog_File you need to call NcbiLog_SetDestinationFile(), that accept file name as parameter. Also, an environment variable $NCBI_CONFIG__LOG__FILE can be used to define a base file name for logging. But it is recommended to use NcbiLog_SetDestinationFile() if you need to log into some local file.
By default, if SetDestination() has not called or set to eNcbiLog_Default, and environment variable $NCBI_CONFIG__LOG__FILE is defined and not empty, its value will be used as base name for logfiles. It can have special value "-" to redirect all output to STDERR.
See also
ENcbiLog_Destination, NcbiLog_Init, NcbiLog_SetSplitLogFile, NcbiLog_SetDestinationFile

Definition at line 2753 of file ncbi_c_log.c.

References CLOSE_CLEANUP, SInfo_tag::destination, eNcbiLog_Default, eNcbiLog_Disable, eNcbiLog_Stderr, int, SInfo_tag::last_reopen_time, MT_LOCK_API, MT_UNLOCK, NCBILOG_PORT_MAX, NULL, s_CloseLogFiles(), s_InitDestination(), SInfo_tag::server_port, util::strcmp(), and sx_Info.

Referenced by main().

◆ NcbiLog_SetDestinationFile()

ENcbiLog_Destination NcbiLog_SetDestinationFile ( const char *  logfile_base)

Variant of NcbiLog_SetDestination for logging to a specific file (eNcbiLog_File).

This is CLog/ncbi_applog specific, not a standard feature.

Parameters
logfile_baseA base name for a log file(-es). If splitting is disabled, there will be a single <logfile_base>.log file, or some files with err/perf/trace extentions otherwise.
Returns
The diagnostic destination that was really set. Sets to eNcbiLog_Disable in the case of critical errors.
See also
NcbiLog_SetDestination, ENcbiLog_Destination, NcbiLog_Init

Definition at line 2801 of file ncbi_c_log.c.

References CLOSE_CLEANUP, SInfo_tag::destination, eNcbiLog_Disable, eNcbiLog_File, eNcbiLog_Stderr, SInfo_tag::last_reopen_time, MT_LOCK_API, MT_UNLOCK, NULL, s_CloseLogFiles(), s_InitDestination(), util::strcmp(), and sx_Info.

Referenced by CNcbiApplogApp::Run().

◆ NcbiLog_SetHitID()

void NcbiLog_SetHitID ( const char *  hit_id)

Set hit ID (HID, a.k.a.

PHID) for the request.

This setting is effective for a single request:

If (P)HID has not been explicitly set for a request, that the application- wide value (per NcbiLog_AppSetHitID() or env.variable, if any) will be used for the request as well. If no explicitly set application-wide (P)HID, that new (P)HID will be generated for the request on NcbiLog_ReqStart().

Attention
NcbiLog_ReqStop() resets the request-specific (P)HID back to the application-wide value (if any) or unset state.
PHID will be logged whenever it changes, immediately, if called inside request, or on the next NcbiLog_ReqRun() if called between requests.
Parameters
hit_idNew (P)HID. (It will be URL-encoded.) (P)HID will be unset if the parameter is NULL or point to empty string.
See also
NcbiLog_AppSetHitID, NcbiLog_ReqStart, NcbiLog_ReqRun, NcbiLog_ReqStop, NcbiLog_AppGetHitID, NcbiLog_GetNextSubHitID

Definition at line 3078 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), s_IsInsideRequest(), s_LogHitID(), s_SetHitID(), and util::strcmp().

Referenced by CNcbiApplogApp::SetInfo().

◆ NcbiLog_SetHost()

void NcbiLog_SetHost ( const char *  host)

Set the host name.

By default, this value is taken from the system.

Parameters
hostNew host name. It will be set to 'UNK_HOST' if parameter is NULL or empty string.
Note
This method does not affect GUID value if called after starting logging.

Definition at line 2933 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, and s_SetHost().

Referenced by CNcbiApplogApp::SetInfo().

◆ NcbiLog_SetPostLevel()

ENcbiLog_Severity NcbiLog_SetPostLevel ( ENcbiLog_Severity  sev)

Set new posting severity threshold.

All messages with severity lower than specified will be ignored.

Returns
The severity threshold that was in effect before this call.

Definition at line 3272 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, SInfo_tag::post_level, prev(), and sx_Info.

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_SetProcessId()

void NcbiLog_SetProcessId ( TNcbiLog_PID  pid)

Set process ID (PID).

Note
This method does not affect GUID value if called after starting logging.

Definition at line 2882 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, SInfo_tag::pid, and sx_Info.

◆ NcbiLog_SetRequestId()

void NcbiLog_SetRequestId ( TNcbiLog_Counter  rid)

Set current request ID (RID).

Calling this method before NcbiLog_AppRun() is not allowed.

Note
NcbiLog_SetRequestId() does not affect already started requests. Only newly started request will have new ID.
NcbiLog_ReqStart() automaticaly increases request number. So, next request will start with (rid + 1).
See also
NcbiLog_GetRequestId, NcbiLog_ReqStart

Definition at line 2900 of file ncbi_c_log.c.

References eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, SInfo_tag::rid, SInfo_tag::state, sx_Info, and TROUBLE_MSG.

Referenced by main().

◆ NcbiLog_SetSession()

void NcbiLog_SetSession ( const char *  session)

Set session ID (SID) for the request.

This setting is effective for a single request:

If SID is not explicitly set for a request, then the application- wide value (per NcbiLog_AppSetSession() or NcbiLog_AppNewSession()) will be used for the request.

Attention
NcbiLog_ReqStop() resets the SID back to the application-wide value!
Parameters
sessionNew session ID. (It will be URL-encoded.) It will be set to 'UNK_SESSION' if the parameter is NULL or empty string.
See also
NcbiLog_AppSetSession, NcbiLog_AppNewSession, NcbiLog_ReqStart, NcbiLog_ReqStop

Definition at line 3009 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), and s_SetSession().

Referenced by main(), and CNcbiApplogApp::SetInfo().

◆ NcbiLog_SetSplitLogFile()

void NcbiLog_SetSplitLogFile ( int  value)

Set split log files flag.

If set, the output for log/err/trace/perf records will be sent to a different log files, or to a single .log file, otherwise. Splitting is OFF by default, except if you logging to /log. The log files writting there always split, and you cannot disable this.

Note
You can change splitting if logging destination set to eNcbiLog_Cwd or eNcbiLog_File only.
When logging to /log the log files are always split, regardless of the setting.
See also
NcbiLog_SetDestination

Definition at line 2874 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, SInfo_tag::split_log_file, sx_Info, and rapidjson::value.

Referenced by CNcbiApplogApp::Cmd_Health().

◆ NcbiLog_SetThreadId()

void NcbiLog_SetThreadId ( TNcbiLog_TID  tid)

Set thread ID (TID).

Note
This method does not affect GUID value if called after starting logging.

Definition at line 2890 of file ncbi_c_log.c.

References ctx, MT_LOCK_API, MT_UNLOCK, NULL, and s_GetContext().

◆ NcbiLog_SetTime()

void NcbiLog_SetTime ( time_t  timer,
unsigned long  nanoseconds 
)

Set the posting date and time.

By default, system-provided time is used. It can speed up a logging if date/time is already known before calling any post function. It also can be used to alter the time of the posting.

Parameters
timerGMT date and time at which the message was posted (see time()). This time value will be converted to local date/time automatically. The current date/time will be used if this parameter is zero.
nanosecondsNanosecond part of the time.
Attention
The set value will be used for all subsequent postings! To start using system time again, call NcbiLog_SetTime(0,0).

Definition at line 2923 of file ncbi_c_log.c.

References MT_LOCK_API, MT_UNLOCK, STime_tag::ns, SInfo_tag::post_time, STime_tag::sec, sx_Info, and SInfo_tag::user_posting_time.

Referenced by main().

◆ NcbiLog_Trace()

void NcbiLog_Trace ( const char *  msg)

Writes a message to the <appname>.trace file at level 'TRACE'.

Note that the default log level is ERROR.

See also
NcbiLog_SetPostLevel

Definition at line 3826 of file ncbi_c_log.c.

References eNcbiLog_Trace, and s_PrintMessage().

Referenced by main(), and CNcbiApplogApp::Run().

◆ NcbiLog_UpdateOnFork()

void NcbiLog_UpdateOnFork ( TNcbiLog_OnForkFlags  flags)

Update logging internal information after fork().

This function should be called immediatly after fork(), before any other NcbiLog_* functions, or you will get a wrong and unpredictable output, Updates PID if necessary (in the child process). If PID has not changed (parent process), no other actions are performed. Can do additional actions depending on flags.

See also
NcbiLog_Init, NcbiLog_Destroy

Definition at line 3953 of file ncbi_c_log.c.

References SInfo_tag::app_start_time, buf, ctx, eNcbiLog_AppRun, eNcbiLog_NotSet, flags, fNcbiLog_OnFork_PrintStart, fNcbiLog_OnFork_ResetTimer, SInfo_tag::guid, int, kIdBufSize, MT_LOCK_API, MT_UNLOCK, n, NCBILOG_UINT8_FORMAT_SPEC, NULL, SInfo_tag::phid, s_AppStart(), s_CreateUID(), s_ExtraStr(), s_GetContext(), s_GetTID(), s_GetTime(), s_LogHitID(), s_SetState(), SInfo_tag::state, sx_Info, sx_PID, and VERIFY.

◆ NcbiLog_Warning()

void NcbiLog_Warning ( const char *  msg)

Writes a message to the <appname>.err log at level 'WARNING'.

Note that the default log level is ERROR.

See also
NcbiLog_SetPostLevel

Definition at line 3836 of file ncbi_c_log.c.

References eNcbiLog_Warning, and s_PrintMessage().

Referenced by main(), and CNcbiApplogApp::Run().

◆ New()

virtual CDiagHandler* CDiagFactory::New ( const string s)
pure virtual

◆ OnRequestStart() [1/2]

void CJaegerTracer::OnRequestStart ( CRequestContext context)
overridevirtual

◆ OnRequestStart() [2/2]

virtual void IRequestTracer::OnRequestStart ( CRequestContext context)
pure virtual

Implemented in CJaegerTracer.

◆ OnRequestStop() [1/2]

void CJaegerTracer::OnRequestStop ( CRequestContext context)
overridevirtual

Implements IRequestTracer.

Definition at line 197 of file jaeger_tracer.cpp.

References context, and CJaegerTracerSpan::GetSpan().

◆ OnRequestStop() [2/2]

virtual void IRequestTracer::OnRequestStop ( CRequestContext context)
pure virtual

Implemented in CJaegerTracer.

◆ operator delete()

void CDiagRestorer::operator delete ( void *  )
inlineprivate

Private delete operator.

Prohibit dynamic deallocation (and allocation) because there's no good reason to allow it, and out-of-order destruction is problematic.

Definition at line 2962 of file ncbidiag.hpp.

◆ operator delete[]()

void CDiagRestorer::operator delete[] ( void *  )
inlineprivate

Private delete[] operator.

Prohibit dynamic deallocation (and allocation) because there's no good reason to allow it, and out-of-order destruction is problematic.

Definition at line 2968 of file ncbidiag.hpp.

◆ operator new()

void* CDiagRestorer::operator new ( size_t  )
inlineprivate

Private new operator.

Prohibit dynamic allocation because there's no good reason to allow it, and out-of-order destruction is problematic.

Definition at line 2950 of file ncbidiag.hpp.

◆ operator new[]()

void* CDiagRestorer::operator new[] ( size_t  )
inlineprivate

Private new[] operator.

Prohibit dynamic allocation because there's no good reason to allow it, and out-of-order destruction is problematic.

Definition at line 2956 of file ncbidiag.hpp.

◆ operator()()

virtual void INextDiagMessage::operator() ( SDiagMessage msg)
pure virtual

◆ operator<<() [1/6]

CNcbiOstream& operator<< ( CNcbiOstream os,
const SDiagMessage mess 
)
inline

Insert message in output stream.

Definition at line 1762 of file ncbidiag.hpp.

References SDiagMessage::Write().

◆ operator<<() [2/6]

template<>
const CNcbiDiag& CNcbiDiag::operator<< ( const char *const x) const
inline

Definition at line 1231 of file ncbidiag.hpp.

References CNcbiDiag::operator<<(), and CNcbiDiag::Put().

◆ operator<<() [3/6]

template<class X >
const CNcbiDiag& CNcbiDiag::operator<< ( const X &  x) const
inline

Post the arguments.

See also
Put()

Definition at line 1024 of file ncbidiag.hpp.

References CNcbiDiag::Put().

◆ operator<<() [4/6]

const CNcbiDiag& CNcbiDiag::operator<< ( FIosbaseManip  manip) const

◆ operator<<() [5/6]

const CNcbiDiag& CNcbiDiag::operator<< ( FIosManip  manip) const

◆ operator<<() [6/6]

const CNcbiDiag& CNcbiDiag::operator<< ( FManip  manip) const
inline

Definition at line 1015 of file ncbidiag.hpp.

Referenced by CNcbiDiag::operator<<().

◆ operator=() [1/5]

CDiagContext& CDiagContext::operator= ( const CDiagContext )
private

◆ operator=() [2/5]

CDiagContext_Extra & CDiagContext_Extra::operator= ( const CDiagContext_Extra args)

◆ operator=() [3/5]

CNcbiDiag& CNcbiDiag::operator= ( const CNcbiDiag )
private

Private assignment operator to prohibit assignment.

◆ operator=() [4/5]

CRequestContext& CRequestContext::operator= ( const CRequestContext )
private

◆ operator=() [5/5]

SDiagMessage & SDiagMessage::operator= ( const SDiagMessage message)

◆ ParseCurrFunctName()

void CDiagCompileInfo::ParseCurrFunctName ( void  ) const
private

◆ ParseDiagStream()

void SDiagMessage::ParseDiagStream ( CNcbiIstream in,
INextDiagMessage func 
)
static

Stream parser.

Reads messages from a stream and calls the callback for each message.

Definition at line 5233 of file ncbidiag.cpp.

References ERR_POST_X, Error(), i, in(), and SDiagMessage::SDiagMessage().

◆ ParseMessage()

bool SDiagMessage::ParseMessage ( const string message)

Parse the whole string into the message.

Return true on success, false if parsing failed.

Definition at line 4879 of file ncbidiag.cpp.

References eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, eDiag_Warning, eDiagAppState_AppRun, eDiagSevMin, eDPF_AppLog, eDPF_IsNote, SDiagMessage::eEvent_Extra, SDiagMessage::eEvent_PerfLog, SDiagMessage::eEvent_RequestStart, SDiagMessage::eEvent_RequestStop, SDiagMessage::eEvent_Start, SDiagMessage::eEvent_Stop, SDiagMessage::eFormat_Auto, SDiagMessage::eFormat_New, SDiagMessage::GetEventName(), kDiagTimeFormat, kDiagW_UID, kUnknown_App, kUnknown_Client, kUnknown_Host, kUnknown_Session, SDiagMessageData::m_AppName, SDiagMessageData::m_AppState, SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessageData::m_Class, SDiagMessageData::m_Client, SDiagMessage::m_Data, SDiagMessage::m_ErrCode, SDiagMessage::m_ErrSubCode, SDiagMessage::m_ErrText, SDiagMessageData::m_ErrText, SDiagMessage::m_Event, SDiagMessage::m_File, SDiagMessageData::m_File, SDiagMessage::m_Flags, SDiagMessage::m_Format, SDiagMessage::m_Function, SDiagMessageData::m_Function, SDiagMessageData::m_Host, SDiagMessage::m_Line, SDiagMessageData::m_Message, SDiagMessage::m_Module, SDiagMessageData::m_Module, SDiagMessage::m_PID, SDiagMessage::m_Prefix, SDiagMessage::m_ProcPost, SDiagMessage::m_RequestId, SDiagMessageData::m_Session, SDiagMessage::m_Severity, SDiagMessage::m_ThrPost, SDiagMessage::m_TID, SDiagMessageData::m_Time, SDiagMessage::m_TypedExtra, SDiagMessageData::m_UID, NPOS, s_ParseInt(), s_ParseStr(), s_StrToAppState(), string, NStr::StringToInt(), NStr::StringToUInt8(), CNcbiDiag::StrToSeverityLevel(), tmp, and SDiagMessage::x_ParseExtraArgs().

Referenced by SDiagMessage::SDiagMessage().

◆ PopDiagPostPrefix()

void PopDiagPostPrefix ( void  )

Pop a string from the list of message prefixes.

Definition at line 6119 of file ncbidiag.cpp.

References buf, and GetDiagBuffer().

Referenced by CDiagAutoPrefix::~CDiagAutoPrefix().

◆ Post() [1/12]

void CStreamDiagHandler::Post ( const SDiagMessage mess)
virtual

Post message to the handler.

Implements CDiagHandler.

Definition at line 6434 of file ncbidiag.cpp.

References CDiagLock::ePost, CStreamDiagHandler::m_QuickFlush, CStreamDiagHandler::m_Stream, NcbiFlush, and str().

◆ Post() [2/12]

void CFileHandleDiagHandler::Post ( const SDiagMessage mess)
virtual

◆ Post() [3/12]

void CFileDiagHandler::Post ( const SDiagMessage mess)
virtual

Post message to the handler.

Info and Trace messages are sent to file_name.trace file, all others go to file_name.err file. Application access messages go to file_name.log file.

Implements CDiagHandler.

Definition at line 7100 of file ncbidiag.cpp.

References CStopWatch::Elapsed(), CDiagLock::ePost, CDiagHandler::fDefault, CStopWatch::IsRunning(), kLogReopenDelay, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::Reopen(), s_ReopenEntered, CFileDiagHandler::x_GetDiagFileType(), and CFileDiagHandler::x_GetHandler().

◆ Post() [4/12]

void CAsyncDiagHandler::Post ( const SDiagMessage mess)
virtual

◆ Post() [5/12]

void CSysLog::Post ( const SDiagMessage mess)
virtual

◆ Post() [6/12]

virtual void CDiagHandler::Post ( const SDiagMessage mess)
pure virtual

◆ Post() [7/12]

void CSysLog::Post ( const string message,
EPriority  priority,
EFacility  facility = eDefaultFacility 
)

Definition at line 117 of file syslog.cpp.

References CSysLog::Post(), and CSysLog::x_TranslateFacility().

◆ Post() [8/12]

void CSysLog::Post ( const string message,
EPriority  priority,
int  facility 
)

◆ Post() [9/12]

CDiagContext_Extra CPerfLogger::Post ( CRequestStatus::ECode  status,
CTempString  resource,
CTempString  status_msg = CTempString() 
)
inline

Log the timing; stop and deactivate the timer.

Parameters
resourceName of the resource (must be non-empty, else throws an exception).
statusStatus of the timed code.
status_msgVerbal description of the status of the timed code.
Note
If the timer is already inactive, then post an error (once).
If an external stopwatch was provided, it is stopped by this method.
See also
Discard

Definition at line 436 of file perf_log.hpp.

Referenced by g_DoErasePerfLogging(), g_DoPerfLogging(), CPerfLogGuard::Post(), and s_DoDonePerfLogging().

◆ Post() [10/12]

void CPerfLogGuard::Post ( CRequestStatus::ECode  status,
CTempString  status_msg = CTempString() 
)
inline

Write the collected resource info and timing to the log.

Parameters
statusStatus of the timed code.
status_msgVerbal description of the status of the timed code.
Note
After this any action on this guard will be an error (and no-op).

Definition at line 578 of file perf_log.hpp.

Referenced by CGridRPCBaseClient< CAsnBinCompressed >::Ask(), CGridRPCBaseClient< CAsnBinCompressed >::AskStream(), ColumnarVcfCache::CreateBlob(), CGridRPCBaseClient< CAsnBinCompressed >::x_GetJobById(), CTMS_DisplayTrack_Client::x_HttpFetch(), and CPerfLogGuard::~CPerfLogGuard().

◆ Post() [11/12]

CDiagContext_Extra CPerfLogger::Post ( int  status,
CTempString  resource,
CTempString  status_msg = CTempString() 
)

◆ Post() [12/12]

void CPerfLogGuard::Post ( int  status,
CTempString  status_msg = CTempString() 
)

◆ PostToConsole()

void CDiagHandler::PostToConsole ( const SDiagMessage mess)
virtual

Post message to console regardless of its severity.

Reimplemented in CTeeDiagHandler.

Definition at line 6359 of file ncbidiag.cpp.

References CDiagLock::ePost, CDiagHandler::GetLogName(), IsVisibleDiagPostLevel(), kLogName_Stderr, SDiagMessage::m_Severity, NcbiFlush, and str().

Referenced by CTeeDiagHandler::PostToConsole().

◆ Print() [1/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
bool  value 
)

◆ Print() [2/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
char  value 
)

Definition at line 2708 of file ncbidiag.cpp.

References CDiagContext_Extra::Print(), and rapidjson::value.

◆ Print() [3/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
const char *  value 
)

Overloaded Print() for all types.

Definition at line 2653 of file ncbidiag.cpp.

References CDiagContext_Extra::Print(), and rapidjson::value.

◆ Print() [4/15]

template<class TKey , class TStorage >
CDiagContext_Extra& CDiagContext_Extra::Print ( const string name,
const CStrictId< TKey, TStorage > &  value 
)
inline

Definition at line 1857 of file ncbidiag.hpp.

◆ Print() [5/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
const string value 
)

The method does not print the argument, but adds it to the string.

Name must contain only alphanumeric chars or '_'. Value is URL-encoded before printing.

Definition at line 2622 of file ncbidiag.cpp.

References ERR_POST, kEmptyStr, CDiagContext_Extra::m_Args, s_NcbiApplogKeywords, rapidjson::value, and CDiagContext_Extra::x_CanPrint().

Referenced by CGRPCServerCallbacks::BeginRequest(), CGRPCRequestLogger::CGRPCRequestLogger(), CWNJobWatcher::CheckForInfiniteLoop(), CCgi2RCgiApp::CheckJob(), CVcfTrack::CheckRange(), CompressAssembly(), ColumnarVcfCache::CreateBlob(), CreateErrorRequestContext(), CNetScheduleServer::Exit(), g_DoErasePerfLogging(), g_DoPerfLogging(), g_PostPerf(), CBlastAligner::GenerateAlignments(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), CPerfLogGuard::Post(), CDiagContext_Extra::Print(), SInteractiveNewRequestStart::SExtra::Print(), CStatisticsCounters::PrintDelta(), CDiagContext_Extra::PrintNcbiAppInfoOnRequest(), CDiagContext_Extra::PrintNcbiAppInfoOnStart(), CDiagContext_Extra::PrintNcbiRoleAndLocation(), CHttpRequest::PrintParams(), CStatisticsCounters::PrintServerWide(), CDiagContext::PrintStart(), CQueue::PrintStatistics(), CStatisticsCounters::PrintTransitions(), CCgiSampleApplication::ProcessPrintEnvironment(), COperationTiming::Register(), CIgBlast::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), CNetStorageGCApp::Run(), CAdvancedAlignCleanup::RunSplignOnCompartment(), s_AppendCommonExtras(), CSparseGraph::Save(), ColumnarVcfCache::SetInfoFields(), CDiagContext_Extra::SetType(), CCgi2RCgiApp::SubmitJob(), UncomressAndCreate(), CNgAligner::x_Align_Impl(), CQueue::x_CancelJobs(), CQueue::x_CheckExecutionTimeout(), CSparseGraph::x_CheckRemoteData(), CQueueDataBase::x_CreateAndMountQueue(), CPubseqGatewayApp::x_CreateRequestContext(), CPubseqGatewayApp::x_DispatchRequest(), CNetStorageHandler::x_GetObject(), CGRPCRequestLogger::x_Init(), CNetScheduleHandler::x_LogCommandWithJob(), CDBConnectionFactory::x_LogConnection(), CDiagContext::x_LogEnvironment(), CRequestContext::x_LogHitID(), CDiagContext::x_LogHitID(), CNcbiApplicationAPI::x_LogOptions(), CQueue::x_LogSubmit(), CHttpConnection::x_MaintainBacklog(), CNcbiLogFields::x_Match(), CCgiApplication::x_OnEvent(), CQueueDataBase::x_Open(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageGCApp::x_PrintFinishCounters(), CNetScheduleHandler::x_PrintGetJobResponse(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetStorageHandler::x_PrintMessageRequestStop(), CNetScheduleHandler::x_ProcessChangeAffinity(), CNetScheduleHandler::x_ProcessClearWorkerNode(), CNetStorageHandler::x_ProcessCreate(), CNetScheduleHandler::x_ProcessGetJob(), CNetScheduleHandler::x_ProcessJobExchange(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessReading(), CNetStorageHandler::x_ProcessReconfigure(), CNetScheduleHandler::x_ProcessReloadConfig(), CNetStorageHandler::x_ProcessRelocate(), CNetScheduleHandler::x_ProcessSetAffinity(), CNetScheduleHandler::x_ProcessSetQueue(), CInstancedAligner::x_RunAligner(), CSparseGraph::x_Sync(), and CRequestContext::x_UpdateSubHitID().

◆ Print() [6/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
double  value 
)

◆ Print() [7/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
int  value 
)

Definition at line 2659 of file ncbidiag.cpp.

References NStr::IntToString(), CDiagContext_Extra::Print(), and rapidjson::value.

◆ Print() [8/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
Int8  value 
)

◆ Print() [9/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
long  value 
)

◆ Print() [10/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
signed char  value 
)

Definition at line 2714 of file ncbidiag.cpp.

References CDiagContext_Extra::Print(), and rapidjson::value.

◆ Print() [11/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
Uint8  value 
)

◆ Print() [12/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
unsigned char  value 
)

Definition at line 2720 of file ncbidiag.cpp.

References CDiagContext_Extra::Print(), and rapidjson::value.

◆ Print() [13/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
unsigned int  value 
)

◆ Print() [14/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( const string name,
unsigned long  value 
)

◆ Print() [15/15]

CDiagContext_Extra & CDiagContext_Extra::Print ( TExtraArgs args)

The method does not print the arguments, but adds it to the string.

Name must contain only alphanumeric chars or '_'. Value is URL-encoded before printing. The args will be modified (emptied) by the function.

Definition at line 2738 of file ncbidiag.cpp.

References CDiagContext_Extra::m_Args, and CDiagContext_Extra::x_CanPrint().

◆ PrintExtra()

void CDiagContext::PrintExtra ( const string message)

Print extra message in plain text format.

This method is deprecated and should be replaced by a call to Extra() method and one or more calls to CDiagContext_Extra::Print().

Definition at line 2156 of file ncbidiag.cpp.

References SDiagMessage::eEvent_Extra, and CDiagContext::x_PrintMessage().

◆ PrintNcbiAppInfoOnRequest()

CDiagContext_Extra & CDiagContext_Extra::PrintNcbiAppInfoOnRequest ( void  )
private

◆ PrintNcbiAppInfoOnStart()

CDiagContext_Extra & CDiagContext_Extra::PrintNcbiAppInfoOnStart ( void  )
private

◆ PrintNcbiRoleAndLocation()

CDiagContext_Extra & CDiagContext_Extra::PrintNcbiRoleAndLocation ( void  )
private

◆ PrintProperties()

void CDiagContext::PrintProperties ( void  )

Forced dump of all set properties.

Deprecated:

Definition at line 2085 of file ncbidiag.cpp.

References SDiagMessage::eEvent_Extra, CDiagLock::eRead, ITERATE, CDiagContext::m_Properties, and CDiagContext::x_PrintMessage().

◆ PrintRequestStart() [1/2]

void CDiagContext::PrintRequestStart ( const string message)

◆ PrintRequestStart() [2/2]

CDiagContext_Extra CDiagContext::PrintRequestStart ( void  )

Create a temporary CDiagContext_Extra object.

The object will print arguments automatically from destructor. Can be used like: PrintRequestStart().Print(name1, val1).Print(name2, val2);

Definition at line 2162 of file ncbidiag.cpp.

References CDiagContext::CDiagContext_Extra, and SDiagMessage::eEvent_RequestStart.

◆ PrintRequestStop()

void CDiagContext::PrintRequestStop ( void  )

◆ PrintStart()

void CDiagContext::PrintStart ( const string message)

Print start/stop etc.

message. If the following values are set as properties, they will be dumped before the message: host | host_ip_addr client_ip session_id app_name All messages have the following prefix: PID/TID/ITER UID TIME HOST CLIENT SESSION_ID APP_NAME Depending on its type, a message can be prefixed with the following properties if they are set: start stop [SIG] [EXIT_CODE] ELAPSED_TIME extra request-start request-stop [STATUS] [REQ_ELAPSED_TIME] [BYTES_RD] [BYTES_WR]

Definition at line 2095 of file ncbidiag.cpp.

References SDiagMessage::eEvent_Start, CDiagContext::eHitID_NoCreate, env, CFile::Exists(), CDiagContext::Extra(), f(), CDiagContext_Extra::Flush(), NStr::fSplit_Tokenize, in(), n, NPOS, CDiagContext_Extra::Print(), CDiagContext_Extra::PrintNcbiAppInfoOnRequest(), CDiagContext_Extra::PrintNcbiAppInfoOnStart(), CDiagContext_Extra::PrintNcbiRoleAndLocation(), NStr::ReplaceInPlace(), NStr::SplitInTwo(), NStr::ToLower(), NStr::TruncateSpaces(), rapidjson::value, CDiagContext::x_GetDefaultHitID(), CDiagContext::x_LogEnvironment(), and CDiagContext::x_PrintMessage().

Referenced by CCgiApplication::AppStart(), and CNcbiApplicationAPI::AppStart().

◆ PrintStop()

void CDiagContext::PrintStop ( void  )

◆ PushDiagPostPrefix()

void PushDiagPostPrefix ( const char *  prefix)

Push a string to the list of message prefixes.

Definition at line 6109 of file ncbidiag.cpp.

References buf, GetDiagBuffer(), and prefix.

Referenced by CDiagAutoPrefix::CDiagAutoPrefix(), and CCgiApplication::Run().

◆ PushMessage()

void CDiagContext::PushMessage ( const SDiagMessage message)

Save new message.

Definition at line 3379 of file ncbidiag.cpp.

References CDiagContext::m_MaxMessages, and CDiagContext::m_Messages.

◆ Put() [1/8]

template<class X >
const CNcbiDiag& CNcbiDiag::Put ( const CException ,
const X &  x 
) const
inline

Helper method to post an exception to diagnostic stream.

Example: CNcbiDiag() << ex;

Definition at line 975 of file ncbidiag.hpp.

References CNcbiDiag::x_Put().

◆ Put() [2/8]

const CNcbiDiag & CNcbiDiag::Put ( const CStackTrace ,
const CStackTrace stacktrace 
) const

Helper method to post stack trace to diagnostic stream using standard stack trace formatting.

Example: CNcbiDiag() << "My message" << CStackTrace();

Definition at line 7790 of file ncbidiag.cpp.

References CStackTrace::Empty(), s_FormatStackTrace(), and CStackTrace::SetPrefix().

◆ Put() [3/8]

const CNcbiDiag& CNcbiDiag::Put ( const ErrCode ,
const ErrCode err_code 
) const

Helper method to post error code and subcode to diagnostic stream.

Example: CNcbiDiag() << ErrCode(5,3) << "My message";

◆ Put() [4/8]

template<class X >
const CNcbiDiag& CNcbiDiag::Put ( const exception *  ,
const X &  x 
) const
inline

Definition at line 980 of file ncbidiag.hpp.

References CNcbiDiag::Put(), and CNcbiDiag::x_Put().

◆ Put() [5/8]

const CNcbiDiag& CNcbiDiag::Put ( const  FManip,
const FManip manip 
) const
inline

Helper method to handle various diagnostic stream manipulators.

For example, to set the message severity level to INFO: CNcbiDiag() << Info << "My message";

Definition at line 1011 of file ncbidiag.hpp.

◆ Put() [6/8]

const CNcbiDiag& CNcbiDiag::Put ( const NCBI_NS_NCBI::SetPostFlags *  ,
const NCBI_NS_NCBI::SetPostFlags &  flags 
) const

Helper method to set specific post flags.

Example: CNcbiDiag() << SetPostFlags(eDPF_DateTime) << "My message";

◆ Put() [7/8]

const CNcbiDiag& CNcbiDiag::Put ( const Severity ,
const Severity severity 
) const

Helper method to set severity level.

Example: CNcbiDiag() << Severity(eDiag_Error) << "My message";

◆ Put() [8/8]

template<class X >
const CNcbiDiag& CNcbiDiag::Put ( const volatile void *  ,
const X &  x 
) const

Generic method to post to diagnostic stream.

Referenced by CNcbiDiag::operator<<(), and CNcbiDiag::Put().

◆ Read() [1/2]

bool CDiagErrCodeInfo::Read ( CNcbiIstream is)

Read error description from specified stream.

Read error descriptions from the specified stream, store it in memory.

Definition at line 8260 of file ncbidiag.cpp.

References ErrCode, kEmptyStr, NcbiGetlineEOL(), s_ParseErrCodeInfoStr(), CDiagErrCodeInfo::SetDescription(), NStr::StartsWith(), and str().

◆ Read() [2/2]

bool CDiagErrCodeInfo::Read ( const string file_name)

Read error description from specified file.

Read error descriptions from the specified file, store it in memory.

Definition at line 8188 of file ncbidiag.cpp.

References file_name.

◆ Release() [1/3]

void CDiagCollectGuard::Release ( EAction  action)

Release the guard.

Perform the specified action, stop collecting messages, reset severities set by this guard.

Definition at line 582 of file ncbidiag.cpp.

References CDiagCollectGuard::Release(), and CDiagCollectGuard::SetAction().

◆ Release() [2/3]

void CDiagCollectGuard::Release ( void  )

Release the guard.

Perform the currently set action, stop collecting messages, reset severities set by this guard.

Definition at line 575 of file ncbidiag.cpp.

References CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::RemoveCollectGuard().

Referenced by CConnTestThread::Main(), CDiagCollectGuard::Release(), CRPCClient_Base::x_Ask(), and CDiagCollectGuard::~CDiagCollectGuard().

◆ Release() [3/3]

void CRequestContextGuard_Base::Release ( void  )

Release the guarded context, restore the saved context if any, do not perform any other actions (logging, setting status).

Definition at line 944 of file request_ctx.cpp.

References GetDiagContext(), CRef< C, Locker >::GetNonNullPointer(), CRequestContextGuard_Base::m_RequestContext, CRequestContextGuard_Base::m_SavedContext, CRef< C, Locker >::Reset(), and CDiagContext::SetRequestContext().

◆ RemoveFromDiag()

void CAsyncDiagHandler::RemoveFromDiag ( void  )

Remove this DiagHandler from diagnostics.

This method must be called if InstallToDiag was called. Object cannot be destroyed if InstallToDiag was called and RemoveFromDiag wasn't called. If InstallToDiag wasn't called then this method does nothing and is safe to be executed.

Definition at line 7242 of file ncbidiag.cpp.

References _ASSERT, GetDiagHandler(), CAsyncDiagHandler::m_AsyncThread, CAsyncDiagThread::m_SubHandler, NULL, CObject::RemoveReference(), SetDiagHandler(), and CAsyncDiagThread::Stop().

◆ Reopen() [1/4]

void CFileHandleDiagHandler::Reopen ( TReopenFlags  )
virtual

◆ Reopen() [2/4]

void CFileDiagHandler::Reopen ( TReopenFlags  )
virtual

◆ Reopen() [3/4]

void CAsyncDiagHandler::Reopen ( TReopenFlags  )
virtual

Reopen file to enable log rotation.

Reimplemented from CDiagHandler.

Definition at line 7261 of file ncbidiag.cpp.

References flags, CAsyncDiagHandler::m_AsyncThread, CAsyncDiagThread::m_SubHandler, and CDiagHandler::Reopen().

◆ Reopen() [4/4]

virtual void CDiagHandler::Reopen ( TReopenFlags  )
inlinevirtual

Reopen file to enable log rotation.

Reimplemented in CTeeDiagHandler, CAsyncDiagHandler, CFileDiagHandler, and CFileHandleDiagHandler.

Definition at line 2480 of file ncbidiag.hpp.

Referenced by CFileDiagHandler::Reopen(), CAsyncDiagHandler::Reopen(), and CTeeDiagHandler::Reopen().

◆ Reset() [1/2]

void CRequestContext_PassThrough::Reset ( CTempString  name)
inline

Reset property.

Definition at line 1000 of file request_ctx.hpp.

References CRequestContext_PassThrough::m_Context, and CRequestContext::x_ResetPassThroughProp().

◆ Reset() [2/2]

void CRequestContext::Reset ( void  )

◆ ResetIsConsoleFlag()

void CNcbiDiag::ResetIsConsoleFlag ( void  ) const
inline

Reset IsConsole flag.

Definition at line 1197 of file ncbidiag.hpp.

References eDPF_IsConsole, and CNcbiDiag::m_PostFlags.

◆ ResetIsMessageFlag()

void CNcbiDiag::ResetIsMessageFlag ( void  ) const
inline
Deprecated:
Use ResetIsNoteFlag()

Definition at line 1191 of file ncbidiag.hpp.

References CNcbiDiag::ResetIsNoteFlag().

◆ ResetIsNoteFlag()

void CNcbiDiag::ResetIsNoteFlag ( void  ) const
inline

Reset IsNote flag.

Definition at line 1194 of file ncbidiag.hpp.

References eDPF_IsNote, and CNcbiDiag::m_PostFlags.

Referenced by CNcbiDiag::ResetIsMessageFlag().

◆ ResetLogRates()

void CDiagContext::ResetLogRates ( void  )
private

◆ ResetPostFlags()

TDiagPostFlags CNcbiDiag::ResetPostFlags ( TDiagPostFlags  flags) const

Clear specific post flags for the current message.

◆ s_EscapeNewlines()

void SDiagMessage::s_EscapeNewlines ( string buf)
static

Definition at line 5496 of file ncbidiag.cpp.

References buf, and NPOS.

Referenced by SDiagMessage::x_NewWrite().

◆ s_UnescapeNewlines()

void SDiagMessage::s_UnescapeNewlines ( string buf)
static

Definition at line 5515 of file ncbidiag.cpp.

References buf, and NPOS.

◆ SDiagErrCodeDescription() [1/2]

SDiagErrCodeDescription::SDiagErrCodeDescription ( const string message,
const string explanation,
int  severity = -1 
)
inline

Destructor.

Parameters
messageMessage
explanationExplanation of msg.
severityDo not override if set to -1

Definition at line 2999 of file ncbidiag.hpp.

◆ SDiagErrCodeDescription() [2/2]

SDiagErrCodeDescription::SDiagErrCodeDescription ( void  )

Constructor.

Definition at line 8179 of file ncbidiag.cpp.

◆ SDiagMessage() [1/3]

SDiagMessage::SDiagMessage ( const SDiagMessage message)

Copy constructor required to store the messages and flush them when the diagnostics setup is finished.

Definition at line 4582 of file ncbidiag.cpp.

◆ SDiagMessage() [2/3]

SDiagMessage::SDiagMessage ( const string message,
bool result = 0 
)

Parse a string back into SDiagMessage.

Optional bool argument is set to true if the message was parsed successfully.

Definition at line 4540 of file ncbidiag.cpp.

References SDiagMessage::ParseMessage(), and result.

◆ SDiagMessage() [3/3]

SDiagMessage::SDiagMessage ( EDiagSev  severity,
const char *  buf,
size_t  len,
const char *  file = 0,
size_t  line = 0,
TDiagPostFlags  flags = eDPF_Default,
const char *  prefix = 0,
int  err_code = 0,
int  err_subcode = 0,
const char *  err_text = 0,
const char *  module = 0,
const char *  nclass = 0,
const char *  function = 0 
)

◆ SelectLastHitID()

string CRequestContext::SelectLastHitID ( const string hit_ids)
static

Select the last hit id from the list of ids separated with commas and optional spaces.

Definition at line 598 of file request_ctx.cpp.

References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, kEmptyStr, NPOS, and NStr::Split().

Referenced by CDiagContext::x_GetDefaultHitID(), and CCgiRequest::x_InitRequestContext().

◆ SelectLastSessionID()

string CRequestContext::SelectLastSessionID ( const string session_ids)
static

Select the last session id from the list of ids separated with commas and optional spaces, ignore UNK_SESSION value.

Definition at line 612 of file request_ctx.cpp.

References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, kEmptyStr, NPOS, REVERSE_ITERATE, and NStr::Split().

Referenced by CCgiContext::RetrieveTrackingId().

◆ Serialize()

string CRequestContext_PassThrough::Serialize ( EFormat  format) const

◆ Set()

void CRequestContext_PassThrough::Set ( CTempString  name,
CTempString  value 
)
inline

Set or update property value.

Definition at line 986 of file request_ctx.hpp.

References CRequestContext_PassThrough::m_Context, rapidjson::value, and CRequestContext::x_SetPassThroughProp().

◆ SetAbortHandler()

void SetAbortHandler ( FAbortHandler  func = 0)

Set/unset abort handler.

If "func"==0 use default handler.

Definition at line 8141 of file ncbidiag.cpp.

References s_UserAbortHandler.

◆ SetAction()

void CDiagCollectGuard::SetAction ( EAction  action)
inline

Specify on-destroy action.

Definition at line 1362 of file ncbidiag.hpp.

References CDiagCollectGuard::m_Action.

Referenced by CDiagCollectGuard::Release(), and CDBLBClientApp::x_RunLookup().

◆ SetAllowedSessionIDFormat()

void CRequestContext::SetAllowedSessionIDFormat ( ESessionIDFormat  fmt)
static

Definition at line 565 of file request_ctx.cpp.

Referenced by main().

◆ SetAllPostFlags()

void CNcbiDiag::SetAllPostFlags ( TDiagPostFlags  flags) const

Set new post flags for the current message.

◆ SetApplogSeverityLocked()

static void CDiagContext::SetApplogSeverityLocked ( bool  lock)
inlinestatic

◆ SetAppName()

void CDiagContext::SetAppName ( const string app_name)

Set application name.

Definition at line 1884 of file ncbidiag.cpp.

References ERR_POST, CDiagContext::m_AppName, and CDiagContext::m_AppNameSet.

Referenced by CNcbiApplicationAPI::SetProgramDisplayName(), and CDiagContext::SetProperty().

◆ SetAppState() [1/3]

void CDiagContext::SetAppState ( EDiagAppState  state)

◆ SetAppState() [2/3]

void CRequestContext::SetAppState ( EDiagAppState  state)

◆ SetAppState() [3/3]

void CDiagContext::SetAppState ( EDiagAppState  state,
EPropertyMode  mode 
)

◆ SetAutoIncRequestIDOnPost()

void CRequestContext::SetAutoIncRequestIDOnPost ( bool  enable)
inline

Auto-increment request ID with every posted message.

Definition at line 304 of file request_ctx.hpp.

References CRequestContext::m_AutoIncOnPost.

Referenced by CDiagContextThreadData::CDiagContextThreadData(), and main().

◆ SetAutoWrite()

void CDiagContext::SetAutoWrite ( bool  value)

Set AutoWrite flag.

If set, each property is posted to the current app-log stream when a new value is set.

Deprecated:

Definition at line 1913 of file ncbidiag.cpp.

References s_AutoWrite_Context, and rapidjson::value.

◆ SetBadSessionIDAction()

void CRequestContext::SetBadSessionIDAction ( EOnBadSessionID  action)
static

Definition at line 553 of file request_ctx.cpp.

◆ SetBytesRd()

void CRequestContext::SetBytesRd ( Int8  bytes)
inline

◆ SetBytesWr()

void CRequestContext::SetBytesWr ( Int8  bytes)
inline

◆ SetClass() [1/2]

const CNcbiDiag & CNcbiDiag::SetClass ( const char *  nclass) const

Set class name.

Definition at line 7760 of file ncbidiag.cpp.

References CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetClass().

◆ SetClass() [2/2]

void CDiagCompileInfo::SetClass ( const string cls)
private

Definition at line 757 of file ncbidiag.cpp.

References CDiagCompileInfo::m_ClassName, and CDiagCompileInfo::m_ClassSet.

Referenced by CNcbiDiag::SetClass().

◆ SetClientIP()

void CRequestContext::SetClientIP ( const string client)

◆ SetCollectSeverity()

void CDiagCollectGuard::SetCollectSeverity ( EDiagSev  sev)

Set new collect severity.

The new collect severity can not be higher than the current one.

Definition at line 597 of file ncbidiag.cpp.

References CompareDiagPostLevel(), and CDiagCollectGuard::m_CollectSev.

◆ SetCustomThreadSuffix()

void CAsyncDiagHandler::SetCustomThreadSuffix ( const string suffix)

Set custom suffix to use on all threads in the server's pool.

Value can be set only before call to InstallToDiag(), any change of the value after call to InstallToDiag() will be ignored.

Definition at line 7219 of file ncbidiag.cpp.

References CAsyncDiagHandler::m_ThreadSuffix, and suffix.

◆ SetDefaultAutoIncRequestIDOnPost()

void CRequestContext::SetDefaultAutoIncRequestIDOnPost ( bool  enable)
static

Set default auto-increment flag used for each default request context.

Contexts created by users do not check this flag. The flag is not MT-protected.

Definition at line 377 of file request_ctx.cpp.

References CRequestContext::sx_GetDefaultAutoIncRequestIDOnPost().

Referenced by main().

◆ SetDefaultClientIP()

void CDiagContext::SetDefaultClientIP ( const string client_ip)
static

Set new default client ip.

This value is used only if by the time 'request start' is logged there's no explicit ip set in the current request context.

Definition at line 2938 of file ncbidiag.cpp.

References s_DefaultClientIp.

◆ SetDefaultErrorStatus()

void CRequestContextGuard_Base::SetDefaultErrorStatus ( int  status)

Set default error status, which will be used if an uncaught exception is detected.

Definition at line 954 of file request_ctx.cpp.

References CRef< C, Locker >::GetNonNullPointer(), CRequestContextGuard_Base::m_ErrorStatus, and CRequestContextGuard_Base::m_RequestContext.

◆ SetDefaultHitID()

void CDiagContext::SetDefaultHitID ( const string hit_id)

Set new global default hit id.

This value is used only if the per-request hit id is not set.

Definition at line 3062 of file ncbidiag.cpp.

References CDiagContext::m_DefaultHitId, CDiagContext::m_LoggedHitId, and CDiagContext::x_LogHitID().

◆ SetDefaultSessionID()

void CDiagContext::SetDefaultSessionID ( const string session_id)

Set new default session id.

This value is used only if the per-request session id is not set.

Definition at line 2893 of file ncbidiag.cpp.

References CDiagContext::m_DefaultSessionId.

◆ SetDescription()

void CDiagErrCodeInfo::SetDescription ( const ErrCode err_code,
const SDiagErrCodeDescription description 
)

Set error description for specified error code.

If description for this code already exist, then it will be overwritten.

Referenced by CDiagErrCodeInfo::Read().

◆ SetDiagDieLevel()

EDiagSev SetDiagDieLevel ( EDiagSev  die_sev = eDiag_Fatal)

Set the "die" (abort) level for the program.

Abort the application if severity is >= "die_sev". Throw an exception if die_sev is not in the range [eDiagSevMin..eDiag_Fatal].

Returns
Return previous die-level.

Definition at line 6196 of file ncbidiag.cpp.

References eDiag_Fatal, CDiagLock::eWrite, and NCBI_THROW.

◆ SetDiagErrCodeInfo()

void SetDiagErrCodeInfo ( CDiagErrCodeInfo info,
bool  can_delete = true 
)

Set handler for processing error codes.

By default this handler is unset. NcbiApplication can init itself only if registry key DIAG_MESSAGE_FILE section DEBUG) is specified. The value of this key should be a name of the file with the error codes explanations.

Definition at line 7644 of file ncbidiag.cpp.

References CDiagLock::eWrite, and info.

Referenced by CNcbiApplicationAPI::x_HonorStandardSettings(), CDiagRecycler::~CDiagRecycler(), and CDiagRestorer::~CDiagRestorer().

◆ SetDiagFilter()

void SetDiagFilter ( EDiagFilter  what,
const char *  filter_str 
)

Set diagnostic filter.

Diagnostic filter acts as a second level filtering mechanism (the primary established by global error post level)

Parameters
whatFilter is set for
filter_strFilter string
See also
SetDiagPostLevel

Definition at line 7670 of file ncbidiag.cpp.

References eDiagFilter_All, eDiagFilter_Post, eDiagFilter_Trace, CDiagLock::eWrite, s_PostFilter, and s_TraceFilter.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), main(), CConnTestThread::Main(), s_CombineDustMasksWithUserProvidedMasks(), CLogLatencyReport::Start(), CNcbiApplicationAPI::x_HonorStandardSettings(), CBioseqIndex::x_InitFeats(), and CCdregionValidator::x_ValidateCDSPeptides().

◆ SetDiagFixedPostLevel()

void SetDiagFixedPostLevel ( EDiagSev  post_sev)

Sets and locks the level, combining the previous two calls.

Definition at line 6179 of file ncbidiag.cpp.

References DisableDiagPostLevelChange(), and SetDiagPostLevel().

Referenced by CNcbiApplicationAPI::AppMain(), and CNcbiApplicationAPI::x_HonorStandardSettings().

◆ SetDiagHandler() [1/2]

void SetDiagHandler ( CDiagHandler handler,
bool  can_delete = true 
)

◆ SetDiagHandler() [2/2]

void SetDiagHandler ( FDiagHandler  func,
void *  data,
FDiagCleanup  cleanup 
)

Set the diagnostic handler using the specified diagnostic handler and cleanup functions.

Definition at line 8049 of file ncbidiag.cpp.

References cleanup(), data, and SetDiagHandler().

◆ SetDiagPostAllFlags()

TDiagPostFlags SetDiagPostAllFlags ( TDiagPostFlags  flags)

Set global post flags to "flags".

If "flags" have flag eDPF_Default set, it will be replaced by the current global post flags.

Returns
Previously set flags

Definition at line 6065 of file ncbidiag.cpp.

References flags, and s_SetDiagPostAllFlags().

Referenced by CNcbiApplicationAPI::AppMain(), CCgiApplication::ConfigureDiagFormat(), CProjBulderApp::GenerateSummary(), CGridCommandLineInterfaceApp::Run(), and CProjBulderApp::Run().

◆ SetDiagPostFlag()

void SetDiagPostFlag ( EDiagPostFlag  flag)

◆ SetDiagPostLevel()

EDiagSev SetDiagPostLevel ( EDiagSev  post_sev = eDiag_Error)

Set the threshold severity for posting the messages.

This function has effect only if:

  • Environment variable $DIAG_POST_LEVEL is not set, and
  • Registry value of DIAG_POST_LEVEL, section DEBUG is not set

Another way to do filtering is to call SetDiagFilter

Parameters
post_sevPost only messages with severity greater or equal to "post_sev".

Special case: eDiag_Trace – print all messages and turn on the tracing.

Returns
Return previous post-level.
See also
SetDiagFilter(), SetDiagTrace()

Definition at line 6129 of file ncbidiag.cpp.

References eDiag_Info, eDiag_Trace, eDiagSC_Disable, eDiagSevMax, eDT_Enable, CDiagLock::eWrite, NCBI_THROW, and SetDiagTrace().

Referenced by UpdateViewer::BlastNeighbor(), BOOST_AUTO_TEST_CASE(), CAV_DisplayMultiple(), CDiagLevelGuard::CDiagLevelGuard(), Cn3DApp::Cn3DApp(), CCgiApplication::ConfigureDiagThreshold(), CreateMimeFromBiostruc(), BlockMultipleAlignment::ExtractRows(), GetStructureFromCacheFolder(), UpdateViewer::ImportStructure(), CReadresult::Init(), COMSSABase::Init(), COMSSAMerge::Init(), CCompactSAMApplication::Init(), CExonSelectorApplication::Init(), CUsageReportSampleApp::Init(), CNCBIwxApplication::Init(), CXcompareAnnotsApplication::Init(), Cn3DNoWin::Init(), CHgvsToSeqfeatConverter::Init(), CBDB_PhoneBookDemo1::Init(), CBDB_PhoneBookDemo2::Init(), CBDB_PhoneBookDemo3::Init(), CBDB_BLobDemo1::Init(), CBDB_SplitTest::Init(), CBDB_MergeTest::Init(), CTestApplication::Init(), CApp::Init(), CSampleNetScheduleClient::Init(), CSampleNetScheduleNode::Init(), CDataTool::Init(), LoadASNFromIstream(), LoadDataOnly(), main(), ReadCD(), CBasicFastaWrapper::ReadFile(), AlignmentManager::RealignDependentSequences(), CNgAlignApp::Run(), CMkIndexApplication::Run(), COMSSA::Run(), CBlastFormatterApp::Run(), CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CSeedTopApp::Run(), CTblastnApp::Run(), CTblastxApp::Run(), CBlastdbConvertApp::Run(), CMakeBlastDBApp::Run(), CMakeClusterDBApp::Run(), CBlastVdbCmdApp::Run(), CGridCommandLineInterfaceApp::Run(), CIgBlastnApp::Run(), CIgBlastpApp::Run(), CMagicBlastApp::Run(), CRMBlastnApp::Run(), CVecScreenApp::Run(), CBlastKmerBuildIndexApplication::Run(), CMultiApplication::Run(), CAsn2Asn::Run(), BlastdbCopyApplication::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CId1FetchApp::Run(), CId2FetchApp::Run(), CSplitCacheApp::Run(), CWig2tableApplication::Run(), CWinMaskApplication::Run(), CProjBulderApp::Run(), CBam2GraphApp::Run(), s_Dump(), s_DumpSparse(), s_DumpZero(), s_InitializeSubject(), SDiagRestorer::SDiagRestorer(), SetDiagFixedPostLevel(), CDiagContext::SetupDiag(), CTar::x_ReadEntryInfo(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), CDiagLevelGuard::~CDiagLevelGuard(), and SDiagRestorer::~SDiagRestorer().

◆ SetDiagPostPrefix()

void SetDiagPostPrefix ( const char *  prefix)

◆ SetDiagRequestId()

void SetDiagRequestId ( Uint8  id)

◆ SetDiagStream()

void SetDiagStream ( CNcbiOstream os,
bool  quick_flush = true,
FDiagCleanup  cleanup = 0,
void *  cleanup_data = 0,
const string stream_name = "" 
)

Set diagnostic stream.

Error diagnostics are written to output stream "os". This uses the SetDiagHandler() functionality.

Parameters
quick_flushDo stream flush after every message
cleanupCall "cleanup(cleanup_data)" if diag.
cleanup_dataStream is changed (see SetDiagHandler)
stream_nameStream name (e.g. STDERR, file.log)

Definition at line 8083 of file ncbidiag.cpp.

References cleanup(), kLogName_Stderr, kLogName_Stdout, kLogName_Stream, NCBI_LSAN_DISABLE_GUARD, and SetDiagHandler().

Referenced by BOOST_AUTO_TEST_CASE(), CAV_DisplayMultiple(), CNcbiApplogApp::Cmd_Health(), CNCBIwxApplication::Exit(), CTestCompartApplication::Exit(), CDemoScoreBuilderApp::Exit(), CBlastInputDemoApplication::Exit(), CGumbelParamsApplication::Exit(), CBlastKmerApplication::Exit(), CBlastKmerBuildIndexApplication::Exit(), CClustererApplication::Exit(), CMultiApplication::Exit(), COmssa2pepxmlApplication::Exit(), CAgpValidateApplication::Exit(), CAgpconvertApplication::Exit(), CAsnCacheTestApplication::Exit(), CCacheIndexCopyApp::Exit(), CConcatSeqEntriesApplication::Exit(), CAsnCacheDumpSeqIdsApplication::Exit(), CPrimeCacheApplication::Exit(), CReadIndexSpeedApp::Exit(), CAsnSubCacheCreateApplication::Exit(), CWalkAsnCacheApplication::Exit(), CBlastDbCheckApplication::Exit(), BlastdbCopyApplication::Exit(), CConvert2BlastMaskApplication::Exit(), CGuideTreeApplication::Exit(), CVDBBlastnApp::Exit(), CVDBTblastnApp::Exit(), Cn3DNoWin::Exit(), CFeatImportApp::Exit(), CFormatGuessApp::Exit(), CId1FetchApp::Exit(), CId2FetchApp::Exit(), CNmer_repeatsApplication::Exit(), CObjExtractApp::Exit(), SegMaskerApplication::Exit(), CMytestApplication::Exit(), CStreamTestApp::Exit(), CObjConvProfile::Exit(), CAppJobTestApplication::Exit(), CTestDispatchApp::Exit(), CColumnarVCFReaderApp::Exit(), CReadFilesApp::Exit(), CProcessFilesApp::Exit(), CDbapiSimpleApp::Exit(), CBam2GraphApp::Exit(), CConvImageApp::Exit(), CImageDemoApp::Exit(), CSubImageApp::Exit(), CNcbiApplicationAPI::FlushDiag(), main(), Cn3DApp::OnExit(), CTbl2AsnApp::ProcessOneFile(), CNcbiApplogApp::Run(), CAsn2Asn::Run(), CId1FetchApp::Run(), CId2FetchApp::Run(), CAlnVwrApp::Run(), SetLogFile(), CAlnMrgApp::SetOptions(), and CDiagContext::SetupDiag().

◆ SetDiagTrace()

void SetDiagTrace ( EDiagTrace  how,
EDiagTrace  dflt = eDT_Default 
)

◆ SetDiagTraceAllFlags()

TDiagPostFlags SetDiagTraceAllFlags ( TDiagPostFlags  flags)

Versions of the above for extra trace flags.

ATTENTION: Thus set trace flags will be ADDED to the regular posting flags.

Definition at line 6081 of file ncbidiag.cpp.

References flags, and s_SetDiagPostAllFlags().

Referenced by CGridCommandLineInterfaceApp::Run().

◆ SetDiagTraceFlag()

void SetDiagTraceFlag ( EDiagPostFlag  flag)

Definition at line 6086 of file ncbidiag.cpp.

References s_SetDiagPostFlag().

Referenced by CCgiApplication::CCgiApplication().

◆ SetDiagUserAndHost()

void SetDiagUserAndHost ( TDiagUserAndHost  flags = fDiag_AddUser|fDiag_AddHost)

Set username and hostname properties for the diag context.

Do not update existing properties if fDiag_OverrideExisting is not set.

Definition at line 42 of file ncbi_userhost.cpp.

References CORE_GetUsername(), ctx, fDiag_AddHost, fDiag_AddUser, fDiag_OverrideExisting, flags, GetDiagContext(), CSocketAPI::gethostname(), CDiagContext::SetHostname(), and CDiagContext::SetUsername().

Referenced by SNetScheduleAPIImpl::Init(), and CGridCommandLineInterfaceApp::Run().

◆ SetDoubleDiagHandler()

void SetDoubleDiagHandler ( void  )

Output diagnostics using both old and new style handlers.

Deprecated:

Definition at line 8129 of file ncbidiag.cpp.

References ERR_POST_X, and Error().

◆ SetDtab()

void CRequestContext::SetDtab ( const string dtab)
inline

◆ SetErrorCode()

const CNcbiDiag& CNcbiDiag::SetErrorCode ( int  code = 0,
int  subcode = 0 
) const

Set error code and subcode numbers.

Referenced by s_c2cxxErrorHandler(), and s_LOG_Handler().

◆ SetExitCode()

void CDiagContext::SetExitCode ( int  exit_code)
inline

◆ SetExitSignal()

void CDiagContext::SetExitSignal ( int  exit_sig)
inline

Set exit signal.

Definition at line 2185 of file ncbidiag.hpp.

References CDiagContext::m_ExitSig.

Referenced by CDiagContext::SetProperty().

◆ SetFastCGIIteration()

void SetFastCGIIteration ( Uint8  id)
inline

Definition at line 1417 of file ncbidiag.hpp.

References SetDiagRequestId().

◆ SetFile() [1/2]

const CNcbiDiag & CNcbiDiag::SetFile ( const char *  file) const

Set file name to post.

Definition at line 7746 of file ncbidiag.cpp.

References file, CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetFile().

Referenced by s_c2cxxErrorHandler().

◆ SetFile() [2/2]

void CDiagCompileInfo::SetFile ( const string file)
private

Definition at line 722 of file ncbidiag.cpp.

References file, CDiagCompileInfo::m_File, and CDiagCompileInfo::m_StrFile.

Referenced by CNcbiDiag::SetFile().

◆ SetFunction() [1/2]

const CNcbiDiag & CNcbiDiag::SetFunction ( const char *  function) const

Set function name.

Definition at line 7767 of file ncbidiag.cpp.

References CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetFunction().

◆ SetFunction() [2/2]

void CDiagCompileInfo::SetFunction ( const string func)
private

◆ SetGlobalAppState()

void CDiagContext::SetGlobalAppState ( EDiagAppState  state)

Set global application state.

Do not change state of the current thread.

Definition at line 2809 of file ncbidiag.cpp.

References CDiagContext::m_AppState.

Referenced by CNcbiApplicationAPI::CNcbiApplicationAPI(), CDiagContext::SetAppState(), and CNcbiApplicationAPI::x_TryMain().

◆ SetHitID() [1/2]

void CRequestContext::SetHitID ( const string hit)

◆ SetHitId()

void CSharedHitId::SetHitId ( const string hit_id)
inline

Set new hit id value. This resets sub-hit counter and makes it non-shared.

Definition at line 94 of file request_ctx.hpp.

References CDiagContext::GetAppState(), GetDiagContext(), CSharedHitId::m_AppState, CSharedHitId::m_SharedSubHitId, CSharedHitId::m_SubHitId, and CSharedHitId::x_SetHitId().

Referenced by CRequestContext::UnsetHitID().

◆ SetHitID() [2/2]

const string & CRequestContext::SetHitID ( void  )

Generate unique hit id, assign it to this request, return the hit id value.

Definition at line 217 of file request_ctx.cpp.

References GetDiagContext(), CSharedHitId::GetHitId(), CRequestContext::m_HitID, and CRequestContext::x_CanModify().

Referenced by CRequestContext::x_GetHitID().

◆ SetHostIP()

void CDiagContext::SetHostIP ( const string ip)

Set host IP address.

Definition at line 1844 of file ncbidiag.cpp.

Referenced by CDiagContext::SetProperty().

◆ SetHostname()

void CDiagContext::SetHostname ( const string hostname)

Set hostname.

See also
SetDiagUserAndHost

Definition at line 1838 of file ncbidiag.cpp.

Referenced by SetDiagUserAndHost(), and CDiagContext::SetProperty().

◆ SetLine() [1/2]

void CDiagCompileInfo::SetLine ( int  line)
private

Definition at line 736 of file ncbidiag.cpp.

References CDiagCompileInfo::m_Line.

◆ SetLine() [2/2]

const CNcbiDiag& CNcbiDiag::SetLine ( size_t  line) const

Set line number for post.

Referenced by s_c2cxxErrorHandler().

◆ SetLogFile() [1/2]

bool CFileDiagHandler::SetLogFile ( const string file_name,
EDiagFileType  file_type,
bool  quick_flush 
)

Set new log file.

Parameters
file_nameFile name. If file_type is eDiagFile_All, the output will be written to file_name.(err|log|trace). Otherwise the filename is used as-is. Special filenames are: "" - disable diag messages; "-" - print to stderr "/dev/null" - never add .(err|log|trace) to the name.
file_typeType of log file to set - error, trace or application log.
quick_flushDo stream flush after every message.

Definition at line 6884 of file ncbidiag.cpp.

References eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, err_handler(), file_name, file_type, CDirEntry::GetBase(), CDirEntry::GetDir(), CDirEntry::GetExt(), kLogName_None, kLogName_Stderr, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_OwnErr, CFileDiagHandler::m_OwnLog, CFileDiagHandler::m_OwnPerf, CFileDiagHandler::m_OwnTrace, CFileDiagHandler::m_Perf, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::m_Trace, CStopWatch::Restart(), s_CreateHandler(), s_IsSpecialLogName(), s_SplitLogFile, CFileDiagHandler::SetLogName(), and CFileDiagHandler::x_SetHandler().

Referenced by CFileDiagHandler::CFileDiagHandler().

◆ SetLogFile() [2/2]

bool SetLogFile ( const string file_name,
EDiagFileType  file_type = eDiagFile_All,
bool  quick_flush = true 
)

Set log files.

Send output to file_name or to file_name.(err|log|trace) depending on the split log file flag and file_type. If a single file type is selected, other types remain the same or are switched to stderr if their files have not been assigned yet. If split log flag is off, any file type except eDiagFile_All will be ignored. If the file_name contains one of the extensions .log, .err or .trace and the file type is eDiagFile_All, the extension will be removed before adding the new one. Return true on success, false if the file could not be open.

Definition at line 7528 of file ncbidiag.cpp.

References eDiagFile_All, ERR_POST_X, file_name, file_type, GetDiagHandler(), CDirEntry::GetDir(), Info(), kLogName_None, kLogName_Stderr, NcbiCerr, s_IsSpecialLogName(), s_SplitLogFile, CDiagContext::SetApplogSeverityLocked(), SetDiagHandler(), SetDiagStream(), and SetSplitLogFile().

Referenced by OpenLogFileFromConfig(), CDiagContext::SetupDiag(), and CAsnvalApp::x_AliasLogFile().

◆ SetLogName() [1/3]

void CStreamDiagHandler_Base::SetLogName ( const string log_name)
protected

◆ SetLogName() [2/3]

void CFileHandleDiagHandler::SetLogName ( const string log_name)
protectedvirtual

◆ SetLogName() [3/3]

void CFileDiagHandler::SetLogName ( const string log_name)
protectedvirtual

◆ SetLogRate_Limit()

void CDiagContext::SetLogRate_Limit ( ELogRate_Type  type,
unsigned int  limit 
)

◆ SetLogRate_Period()

void CDiagContext::SetLogRate_Period ( ELogRate_Type  type,
unsigned int  period 
)

◆ SetLogTruncate()

void CDiagContext::SetLogTruncate ( bool  value)
static

Set log file truncation flag.

Definition at line 3475 of file ncbidiag.cpp.

References rapidjson::value.

Referenced by NcbiSys_main().

◆ SetModule() [1/2]

const CNcbiDiag & CNcbiDiag::SetModule ( const char *  module) const

Set module name.

Definition at line 7753 of file ncbidiag.cpp.

References CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetModule().

Referenced by s_c2cxxErrorHandler().

◆ SetModule() [2/2]

void CDiagCompileInfo::SetModule ( const string module)
private

Definition at line 729 of file ncbidiag.cpp.

References CDiagCompileInfo::m_Module, and CDiagCompileInfo::m_StrModule.

Referenced by CNcbiDiag::SetModule().

◆ SetOldPostFormat()

void CDiagContext::SetOldPostFormat ( bool  value)
static

Set old/new format flag.

Definition at line 3352 of file ncbidiag.cpp.

References s_OldPostFormat, and rapidjson::value.

Referenced by init_common(), main(), Main(), s_RestoreOrigDiagHandler(), and CLogLatencyReport::Start().

◆ SetOmitStackTrace()

void CNcbiDiag::SetOmitStackTrace ( bool  value)
inline

Definition at line 1200 of file ncbidiag.hpp.

References CNcbiDiag::m_OmitStackTrace, and rapidjson::value.

Referenced by CExceptionReporter::ReportDefaultEx().

◆ SetON()

void CPerfLogger::SetON ( bool  enable = true)
static

Turn performance logging on/off globally.

Definition at line 64 of file perf_log.cpp.

◆ SetOwnership()

void CFileDiagHandler::SetOwnership ( CStreamDiagHandler_Base handler,
bool  own 
)

◆ SetPostFlags() [1/2]

SetPostFlags::SetPostFlags ( TDiagPostFlags  flags)
inline

Definition at line 850 of file ncbidiag.hpp.

◆ SetPostFlags() [2/2]

TDiagPostFlags CNcbiDiag::SetPostFlags ( TDiagPostFlags  flags) const

Set specific post flags for the current message.

◆ SetPrintSeverity()

void CDiagCollectGuard::SetPrintSeverity ( EDiagSev  sev)

Set new print severity.

The new print severity can not be lower than the current one.

Definition at line 589 of file ncbidiag.cpp.

References CompareDiagPostLevel(), and CDiagCollectGuard::m_PrintSev.

◆ SetProperty() [1/2]

void CRequestContext::SetProperty ( const string name,
const string value 
)

◆ SetProperty() [2/2]

void CDiagContext::SetProperty ( const string name,
const string value,
EPropertyMode  mode = eProp_Default 
)

Set application context property by name.

Write property to the log if AutoPrint flag is set. Property mode defines if the property is a global or a per-thread one. By default unknown properties are set as thread-local.

Deprecated:

Definition at line 1931 of file ncbidiag.cpp.

References SDiagMessage::eEvent_Extra, CDiagContext::eProp_Default, CDiagContext::eProp_Global, CDiagContext::eProp_Thread, CDiagLock::eRead, CDiagLock::eWrite, NStr::fConvErr_NoThrow, CDiagContext::GetRequestContext(), IsGlobalProperty(), CDiagContext::kProperty_AppName, CDiagContext::kProperty_AppState, CDiagContext::kProperty_BytesRd, CDiagContext::kProperty_BytesWr, CDiagContext::kProperty_ClientIP, CDiagContext::kProperty_ExitCode, CDiagContext::kProperty_ExitSig, CDiagContext::kProperty_HostIP, CDiagContext::kProperty_HostName, CDiagContext::kProperty_ReqStatus, CDiagContext::kProperty_ReqTime, CDiagContext::kProperty_SessionID, CDiagContext::kProperty_UserName, CDiagContext::m_Properties, s_AutoWrite_Context, s_StrToAppState(), CDiagContext::SetAppName(), CDiagContext::SetAppState(), CRequestContext::SetBytesRd(), CRequestContext::SetBytesWr(), CRequestContext::SetClientIP(), CDiagContext::SetExitCode(), CDiagContext::SetExitSignal(), CDiagContext::SetHostIP(), CDiagContext::SetHostname(), CRequestContext::SetRequestStatus(), CRequestContext::SetSessionID(), CDiagContext::SetUsername(), CDiagContext::sm_Instance, NStr::StringToInt(), NStr::StringToInt8(), CRequestContext::UnsetRequestStatus(), rapidjson::value, and CDiagContext::x_PrintMessage().

◆ SetReadOnly()

void CRequestContext::SetReadOnly ( bool  read_only)
inline

Switch request context to read-only mode.

A read-only context can be attached to multiple threads. The mode must be disabled before making any modifications (e.g. printing request-stop). To avoid overhead CRequestContext does not check if there are any threads currently using the same context in a different mode. Any attempts to modify request context while in read-only mode are ignored and reported as an error (once per process). Note that some const methods may still need to modify the context (e.g. GetHitID() generates a new hit id if it's not yet assigned). To prevent the above error from being logged, the method should be called at least once before switching to read-only mode.

Definition at line 372 of file request_ctx.hpp.

References CRequestContext::m_IsReadOnly.

Referenced by CPSGS_Request::SetRequestContext().

◆ SetRequestContext()

void CDiagContext::SetRequestContext ( CRequestContext ctx)
static

Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()

Definition at line 1907 of file ncbidiag.cpp.

References ctx, CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::SetRequestContext().

Referenced by CNSClientsRegistry::ClearOnTimeout(), CreateErrorRequestContext(), CRequestContextSwitcher::CRequestContextSwitcher(), DismissErrorRequestContext(), SAsyncWriteTask::Execute(), CNetScheduleServer::Exit(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CNetStorageHandler::OnOverflow(), CNetStorageHandler::OnRead(), CStatisticsCounters::PrintServerWide(), CQueue::PrintStatistics(), CRequestContextSwitcher::Release(), CRequestContextGuard_Base::Release(), CNetStorageGCDatabase::RemoveObject(), SPSG_Request::SContext::Set(), CPSGS_Request::SetRequestContext(), SNewRequestContext::SNewRequestContext(), CThread::Wrapper(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CPubseqGatewayApp::x_CreateRequestContext(), CPubseqGatewayApp::x_DispatchRequest(), CGetJobNotificationThread::x_DoJob(), CJobQueueCleanerThread::x_DoJob(), CJobQueueExecutionWatcherThread::x_DoJob(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetScheduleHandler::x_PrintCmdRequestStop(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetStorageHandler::x_PrintMessageRequestStop(), CPubseqGatewayApp::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetStorageGCApp::x_RemoveObjects(), CGraphCache< TData >::x_Run(), CNetScheduleHandler::x_SetRequestContext(), CNcbiApplicationAPI::x_TryMain(), CRequestContextResetter::~CRequestContextResetter(), and SNewRequestContext::~SNewRequestContext().

◆ SetRequestID() [1/2]

void CRequestContext::SetRequestID ( TCount  rid)
inline

◆ SetRequestID() [2/2]

CRequestContext::TCount CRequestContext::SetRequestID ( void  )
inline

Assign the next available request ID to this request.

Definition at line 649 of file request_ctx.hpp.

References CRequestContext::GetNextRequestID(), CRequestContext::m_RequestID, and CRequestContext::x_CanModify().

◆ SetRequestStatus() [1/2]

void CRequestContext::SetRequestStatus ( CRequestStatus::ECode  code)
inline

◆ SetRequestStatus() [2/2]

void CRequestContext::SetRequestStatus ( int  status)
inline

Definition at line 828 of file request_ctx.hpp.

References CRequestContext::eProp_ReqStatus, CRequestContext::m_ReqStatus, CRequestContext::x_CanModify(), and CRequestContext::x_SetProp().

Referenced by CNcbiTestsObserver::assertion_result(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CNetScheduleHandler::OnMessage(), CNetScheduleHandler::OnTimeout(), CNetStorageHandler::OnTimeout(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CCgiApplication::SetHTTPStatus(), CCgiRequestProcessor::SetHTTPStatus(), CDiagContext::SetProperty(), CRequestContext::SetRequestStatus(), CRequestContextGuard_Base::SetStatus(), CCgiResponse::SetStatus(), CBlobCacher::x_CancelCaching(), CNCMessageHandler::x_CloseCmdAndConn(), CNCMessageHandler::x_CloseOnPeerError(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CBlobCacher::x_DelFileAndRetryCreate(), CNCMessageHandler::x_DoCmd_CopyProlong(), CNCMessageHandler::x_DoCmd_CopyPut(), CNCMessageHandler::x_DoCmd_Get(), CNCMessageHandler::x_DoCmd_GetStat(), CNCMessageHandler::x_DoCmd_HasBlob(), CNCMessageHandler::x_DoCmd_IC_Store(), CNCMessageHandler::x_DoCmd_Put(), CNCMessageHandler::x_DoCmd_ReConfig(), CNCMessageHandler::x_DoCmd_SetValid(), CNCMessageHandler::x_DoCmd_SyncGet(), CNCMessageHandler::x_DoCmd_SyncStart(), CSpaceShrinker::x_FinishMoves(), CNCMessageHandler::x_FinishReadingBlob(), CNCActiveSyncControl::x_FinishSync(), CNetScheduleHandler::x_HandleSocketErrorOnResponse(), CCgiApplication::x_OnEvent(), CNetStorageHandler::x_OnSocketWriteError(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageHandler::x_PrintMessageRequestStart(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgRequest(), CNCActiveHandler::x_ProcessPeerError(), CNCMessageHandler::x_ProxyToNextPeer(), CNCMessageHandler::x_ReadAuthMessage(), CNCMessageHandler::x_ReadBlobChunk(), CNCMessageHandler::x_ReadBlobChunkLength(), CNCMessageHandler::x_ReadBlobSignature(), CNCMessageHandler::x_ReadCommand(), CNCMessageHandler::x_ReportError(), CNetScheduleHandler::x_SetCmdRequestStatus(), CNetStorageHandler::x_SetCmdRequestStatus(), CNetScheduleHandler::x_SetConnRequestStatus(), CNetStorageHandler::x_SetConnRequestStatus(), CNCMessageHandler::x_StartCommand(), CNCMessageHandler::x_WaitForPeerAnswer(), CNCMessageHandler::x_WriteBlobData(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().

◆ SetRequestTracer()

void CRequestContext::SetRequestTracer ( const shared_ptr< IRequestTracer > &  tracer)
inline

Set request tracer to be called on context events (start/stop etc.).

See also
IRequestTracer

Definition at line 384 of file request_ctx.hpp.

References CRequestContext::m_Tracer.

◆ SetSessionID() [1/2]

void CRequestContext::SetSessionID ( const string session)

◆ SetSessionID() [2/2]

const string & CRequestContext::SetSessionID ( void  )

◆ SetSeverityCap()

void CDiagCollectGuard::SetSeverityCap ( EDiagSev  sev)
inline

Set new severity cap for use in PrintCapped mode.

Definition at line 1357 of file ncbidiag.hpp.

References CDiagCollectGuard::m_SeverityCap.

Referenced by CRPCClient_Base::x_Ask().

◆ SetShared()

void CSharedHitId::SetShared ( void  ) const
inline

Mark this hit id as a shared one and start using shared counter.

Definition at line 80 of file request_ctx.hpp.

References CSharedHitId::IsShared(), CSharedHitId::m_SharedSubHitId, and CSharedHitId::m_SubHitId.

Referenced by CRequestContext::Clone().

◆ SetSplitLogFile()

void SetSplitLogFile ( bool  value = true)

Split log files flag.

If set, the output is sent to different log files depending on the severity level.

Definition at line 6705 of file ncbidiag.cpp.

References s_SplitLogFile, and rapidjson::value.

Referenced by main(), and SetLogFile().

◆ SetStatus()

void CRequestContextGuard_Base::SetStatus ( int  status)
inline

◆ SetSubHandler()

void CFileDiagHandler::SetSubHandler ( CStreamDiagHandler_Base handler,
EDiagFileType  file_type,
bool  own 
)

◆ SetTracerSpan()

void CRequestContext::SetTracerSpan ( const shared_ptr< ITracerSpan > &  span)
inline

Definition at line 386 of file request_ctx.hpp.

References CRequestContext::m_TracerSpan.

◆ SetType()

CDiagContext_Extra & CDiagContext_Extra::SetType ( const string type)

Set extra message type.

Definition at line 2754 of file ncbidiag.cpp.

References kExtraTypeArgName, CDiagContext_Extra::m_Typed, and CDiagContext_Extra::Print().

◆ SetupDiag()

void CDiagContext::SetupDiag ( EAppDiagStream  ds = eDS_Default,
CNcbiRegistry config = NULL,
EDiagCollectMessages  collect = eDCM_NoChange,
const char *  cmd_logfile = NULL 
)
static

Application-wide diagnostics setup.

Attempts to create log files or diag streams according to the 'ds' flag. If 'config' is set, gets name of the log file from the registry.

Definition at line 3545 of file ncbidiag.cpp.

References _ASSERT, _TRACE_X, CDirEntry::ConcatPath(), ctx, eDCM_Discard, eDCM_Flush, eDCM_Init, eDCM_InitNoLimit, eDCM_NoChange, eDiag_Warning, eDiagFile_All, eDiagSC_Unknown, eDS_AppSpecific, eDS_Default, eDS_Disable, eDS_ToMemory, eDS_ToStderr, eDS_ToStdlog, eDS_ToStdout, eDS_ToSyslog, eDS_User, CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, CParamBase::EnableConfigDump(), ERR_POST_X, CDiagLock::eWrite, GetBase(), CDirEntry::GetBase(), GetDefaultLogLocation(), GetDiagContext(), GetDiagHandler(), CDiagHandler::GetLogName(), CDiagContext::GetLogTruncate(), CNcbiApplicationAPI::GetProgramExecutablePath(), CNcbiApplicationAPI::InstanceGuard(), kEmptyStr, kLogName_Memory, kLogName_None, kLogName_Stderr, kLogName_Stdout, CSysLog::kLogName_Syslog, kLogName_Tee, CRequestRateControl::kNoLimit, kRootLog, NCBI_LSAN_DISABLE_GUARD, CDirEntry::NormalizePath(), NStr::NumericToString(), OpenLogFileFromConfig(), s_GetLogConfigBool(), s_GetLogConfigString(), s_LogSizeLimit, CDiagContext::SetApplogSeverityLocked(), SetDiagHandler(), SetDiagPostLevel(), SetDiagStream(), SetLogFile(), and Warning().

Referenced by CNcbiApplicationAPI::AppMain(), InitDiagHandler(), CNcbiApplicationAPI::SetupDiag(), CNcbiApplicationAPI::SetupDiag_AppSpecific(), CDiagContext::SetUseRootLog(), and CNcbiApplicationAPI::x_TryInit().

◆ SetUsername()

void CDiagContext::SetUsername ( const string username)

Set username.

See also
SetDiagUserAndHost

Definition at line 1760 of file ncbidiag.cpp.

References CDiagContext::m_Username.

Referenced by SetDiagUserAndHost(), and CDiagContext::SetProperty().

◆ SetUseRootLog()

void CDiagContext::SetUseRootLog ( void  )
static

@depracated The flag is always set now, the funcion still calls SetupDiag() for compatibility, but has no other effects.

Definition at line 3493 of file ncbidiag.cpp.

References s_FinishedSetupDiag, and CDiagContext::SetupDiag().

◆ Severity()

Severity::Severity ( EDiagSev  sev)
inline

Definition at line 835 of file ncbidiag.hpp.

◆ SeverityName()

static const char* CNcbiDiag::SeverityName ( EDiagSev  sev)
static

◆ Start() [1/2]

void CPerfLogger::Start ( void  )
inline

◆ Start() [2/2]

void CPerfLogGuard::Start ( void  )
inline

Activate and start (or, restart after Suspend()) the timer.

Note
If the timer is already running, post an error (once).
See also
Suspend

Definition at line 551 of file perf_log.hpp.

References CPerfLogGuard::m_Logger, and CPerfLogger::Start().

◆ StartRequest()

void CRequestContext::StartRequest ( void  )
private

◆ StopRequest()

void CRequestContext::StopRequest ( void  )
private

◆ StrToSeverityLevel()

bool CNcbiDiag::StrToSeverityLevel ( const char *  str_sev,
EDiagSev sev 
)
static

Get severity from string.

Parameters
str_sevCan be the numeric value or a symbolic name (see CDiagBuffer::sm_SeverityName[]).
sevSeverity level.
Returns
Return TRUE if severity level known; FALSE, otherwise.

Definition at line 7904 of file ncbidiag.cpp.

References NStr::CompareNocase(), eDiagSevMax, eDiagSevMin, CNcbiDiag::SeverityName(), and NStr::StringToNonNegativeInt().

Referenced by CNcbiApplicationAPI::AppMain(), SDiagMessage::ParseMessage(), s_ParseErrCodeInfoStr(), NParamsBuilder::SBase< SPerformanceParams >::SBase(), CNcbiApplicationAPI::x_HonorStandardSettings(), and CNcbiEncrypt::x_LoadKeys().

◆ Suspend() [1/2]

void CPerfLogger::Suspend ( void  )
inline

◆ Suspend() [2/2]

void CPerfLogGuard::Suspend ( void  )
inline

Suspend the timer.

Call Start() to continue to count time accured before.

See also
Start

Definition at line 558 of file perf_log.hpp.

References CPerfLogGuard::m_Logger, and CPerfLogger::Suspend().

◆ sx_GetContextFieldsMask()

const CMask & CRequestContext::sx_GetContextFieldsMask ( void  )
staticprivate

◆ sx_GetDefaultAutoIncRequestIDOnPost()

bool & CRequestContext::sx_GetDefaultAutoIncRequestIDOnPost ( void  )
staticprivate

◆ sx_NormalizeContextPropertyName()

string CRequestContext::sx_NormalizeContextPropertyName ( const string name)
staticprivate

◆ sx_ThreadDataTlsCleanup()

void CDiagContext::sx_ThreadDataTlsCleanup ( CDiagContextThreadData value,
void *  cleanup_data 
)
staticprivate

◆ UnsetBytesRd()

void CRequestContext::UnsetBytesRd ( void  )
inline

◆ UnsetBytesWr()

void CRequestContext::UnsetBytesWr ( void  )
inline

◆ UnsetClientIP()

void CRequestContext::UnsetClientIP ( void  )
inline

◆ UnsetDiagPostFlag()

void UnsetDiagPostFlag ( EDiagPostFlag  flag)

Unset the specified flag (globally).

Definition at line 6075 of file ncbidiag.cpp.

References s_UnsetDiagPostFlag().

Referenced by CGridCommandLineInterfaceApp::Run().

◆ UnsetDiagTraceFlag()

void UnsetDiagTraceFlag ( EDiagPostFlag  flag)

Definition at line 6091 of file ncbidiag.cpp.

References s_UnsetDiagPostFlag().

Referenced by Cn3DApp::Cn3DApp(), Cn3DNoWin::Init(), and main().

◆ UnsetDtab()

void CRequestContext::UnsetDtab ( void  )
inline

◆ UnsetHitID()

void CRequestContext::UnsetHitID ( void  )
inline

◆ UnsetProperty()

void CRequestContext::UnsetProperty ( const string name)

Remove property from the map.

Definition at line 308 of file request_ctx.cpp.

References map_checker< Container >::erase(), CRequestContext::m_Properties, and CRequestContext::x_CanModify().

◆ UnsetRequestID()

void CRequestContext::UnsetRequestID ( void  )
inline

◆ UnsetRequestStatus()

void CRequestContext::UnsetRequestStatus ( void  )
inline

◆ UnsetSessionID()

void CRequestContext::UnsetSessionID ( void  )
inline

◆ UpdateOnFork()

void CDiagContext::UpdateOnFork ( TOnForkFlags  flags)
static

Update diagnostics after fork().

Updates PID if necessary (in the child process). If PID has not changed (parent process), no other actions are performed. For this reason the method will not do anything after the first call, since no PID changes will be detected.

Warning
The program can be built using multithreaded configurations, but for safety it should have a single thread before fork(). Only in this case it is safe to use any code in the child process.
If your program runs many threads and you call fork() one of them, it is safe to use async-safe calls only, otherwise you can get a dedlock, especially if you use thread locking methods and synchronizations, like mutexes and etc. Diag API is not async-safe, because use strings, memory allocations, streams and etc. Also, in such cases you need to use fOnFork_AsyncSafe flag to use async safe operations only inside this method. Note that this flag disable some initialization of the Diag API after forking.
See also
UpdatePID(), UpdatePID_AsyncSafe(), CCurrentProcess::GetThreadCount(), CCurrentProcess::Fork()

Definition at line 824 of file logging.cpp.

References CDiagContext::UpdatePID().

Referenced by CCurrentProcess::Fork().

◆ UpdatePID()

bool CDiagContext::UpdatePID ( void  )
static

Reset PID cache (e.g. after fork). Return true if PID was updated.

Definition at line 830 of file logging.cpp.

References i, NULL, CSrvDiagMsg::PrintExtra(), CSrvDiagMsg::PrintParam(), s_AppUID, s_InitConstants(), s_InitLogPrefix(), s_MainData, s_MaxRunningThreads, s_Threads, and thr.

Referenced by CFileHandleDiagHandler::Reopen(), and CDiagContext::UpdateOnFork().

◆ UpdatePID_AsyncSafe()

bool CDiagContext::UpdatePID_AsyncSafe ( void  )
static

◆ UpdateUID()

CDiagContext::TUID CDiagContext::UpdateUID ( TUID  uid = 0) const

Take the source UID and replace its timestamp part with the current time.

If the source UID is 0, use the one from the diag context.

Definition at line 1702 of file ncbidiag.cpp.

References CDiagContext::GetUID(), and t.

◆ UseSystemThreadId()

void CDiagContext::UseSystemThreadId ( bool  value = true)
static

Switch printing system TID (rather than CThread::GetSelf()) on/off.

Definition at line 3364 of file ncbidiag.cpp.

References s_PrintSystemTID, and rapidjson::value.

◆ Valid()

bool CFileHandleDiagHandler::Valid ( void  )
inline

◆ Write() [1/2]

CNcbiOstream & SDiagMessage::Write ( CNcbiOstream os,
TDiagWriteFlags  fl = fNone 
) const

Write to stream.

Definition at line 1350 of file logging.cpp.

References buf, ExtractFileName(), file, flags, SDiagMessage::fNoEndl, len, NcbiEndl, prefix, s_ConvertSeverity(), s_SevNames, and string.

◆ Write() [2/2]

void SDiagMessage::Write ( string str,
TDiagWriteFlags  flags = fNone 
) const

◆ WriteMessage() [1/3]

void CDiagHandler::WriteMessage ( const char *  buf,
size_t  len,
EDiagFileType  file_type 
)
virtual

Write string to the log.

The string may contain multiple messages of the same type.

Reimplemented in CFileDiagHandler, and CFileHandleDiagHandler.

Definition at line 6396 of file ncbidiag.cpp.

References _ASSERT.

Referenced by CAsyncDiagThread::Main().

◆ WriteMessage() [2/3]

void CFileHandleDiagHandler::WriteMessage ( const char *  buf,
size_t  len,
EDiagFileType  file_type 
)
virtual

◆ WriteMessage() [3/3]

void CFileDiagHandler::WriteMessage ( const char *  buf,
size_t  len,
EDiagFileType  file_type 
)
virtual

Write string to the log.

The string may contain multiple messages of the same type.

Reimplemented from CDiagHandler.

Definition at line 7143 of file ncbidiag.cpp.

References buf, CStopWatch::Elapsed(), CDiagHandler::fDefault, file_type, CStopWatch::IsRunning(), kLogReopenDelay, len, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::Reopen(), s_ReopenEntered, and CFileDiagHandler::x_GetHandler().

◆ WriteStdPrefix()

void CDiagContext::WriteStdPrefix ( CNcbiOstream ostr,
const SDiagMessage msg 
) const

◆ x_CanModify()

bool CRequestContext::x_CanModify ( void  ) const
inlineprivate

◆ x_CanPrint()

bool CDiagContext_Extra::x_CanPrint ( void  )
private

◆ x_CheckValidity()

bool CPerfLogger::x_CheckValidity ( const CTempString err_msg) const
inlineprivate

◆ x_Connect()

void CSysLog::x_Connect ( void  )
private

◆ x_CreateUID()

void CDiagContext::x_CreateUID ( void  ) const
private

◆ x_CreateUID_AsyncSafe()

void CDiagContext::x_CreateUID_AsyncSafe ( void  ) const
private

◆ x_DeserializeUrlEncoded()

void CRequestContext_PassThrough::x_DeserializeUrlEncoded ( CTempString  data)
private

◆ x_DiagAtApplicationLevel()

bool CDiagContext::x_DiagAtApplicationLevel ( void  ) const
private

◆ x_EndMess()

void CNcbiDiag::x_EndMess ( void  ) const
private

Private replacement for Endm called from manipulators.

Unlike Endm, does not reset ErrCode if buffer is not set.

◆ x_FinalizeSetupDiag()

void CDiagContext::x_FinalizeSetupDiag ( void  )
static

Internal function, should be used only by CNcbiApplication.

Definition at line 3501 of file ncbidiag.cpp.

References _ASSERT, and s_FinishedSetupDiag.

Referenced by CNcbiApplicationAPI::x_TryInit().

◆ x_GetDefaultHitID()

CSharedHitId CDiagContext::x_GetDefaultHitID ( EDefaultHitIDFlags  flag) const
private

◆ x_GetDiagFileType()

EDiagFileType CFileDiagHandler::x_GetDiagFileType ( const SDiagMessage msg) const
private

◆ x_GetHandler()

CStreamDiagHandler_Base * CFileDiagHandler::x_GetHandler ( EDiagFileType  file_type) const
private

◆ x_GetHitID()

string CRequestContext::x_GetHitID ( CDiagContext::EDefaultHitIDFlags  flag) const
private

◆ x_GetModule()

string SDiagMessage::x_GetModule ( void  ) const

◆ x_GetNextHitID()

string CDiagContext::x_GetNextHitID ( bool  is_default) const
private

◆ x_GetPassThroughProp()

const string & CRequestContext::x_GetPassThroughProp ( CTempString  name,
bool  update 
) const
private

◆ x_Init()

void CDiagCollectGuard::x_Init ( EDiagSev  print_severity,
EDiagSev  collect_severity,
EAction  action 
)
private

◆ x_InitData()

void SDiagMessage::x_InitData ( void  ) const
private

◆ x_IsSetDefaultHitID()

bool CDiagContext::x_IsSetDefaultHitID ( void  ) const
private

Definition at line 2990 of file ncbidiag.cpp.

References CDiagContext::m_DefaultHitId.

Referenced by CDiagContext::PrintStop().

◆ x_IsSetOldFormat()

bool SDiagMessage::x_IsSetOldFormat ( void  ) const
inlineprivate

◆ x_IsSetPassThroughProp()

bool CRequestContext::x_IsSetPassThroughProp ( CTempString  name,
bool  update 
) const
private

◆ x_IsSetProp()

bool CRequestContext::x_IsSetProp ( EProperty  prop) const
inlineprivate

◆ x_LoadEnvContextProperties()

void CRequestContext::x_LoadEnvContextProperties ( void  )
private

◆ x_LogEnvironment()

void CDiagContext::x_LogEnvironment ( void  )
staticprivate

◆ x_LogHitID() [1/2]

void CRequestContext::x_LogHitID ( bool  ignore_app_state = false) const
private

◆ x_LogHitID() [2/2]

void CDiagContext::x_LogHitID ( void  ) const
private

◆ x_LogHitID_WithLock()

void CDiagContext::x_LogHitID_WithLock ( void  ) const
private

Definition at line 2983 of file ncbidiag.cpp.

References CDiagContext::x_LogHitID().

Referenced by CDiagContext::PrintRequestStop(), and CDiagContext::PrintStop().

◆ x_LogHitIDOnError()

bool CRequestContext::x_LogHitIDOnError ( void  ) const
inlineprivate

◆ x_Match()

void CNcbiLogFields::x_Match ( const string name,
const string value,
CDiagContext_Extra extra 
) const
private

◆ x_Modify()

void CRequestContext::x_Modify ( void  )
inlineprivate

◆ x_NeedModule()

bool CDiagCompileInfo::x_NeedModule ( void  ) const
private

Definition at line 697 of file ncbidiag.cpp.

References CDiagCompileInfo::m_File, NULL, and util::strcmp().

Referenced by CDiagCompileInfo::CDiagCompileInfo().

◆ x_NewWrite()

CNcbiOstream & SDiagMessage::x_NewWrite ( CNcbiOstream os,
TDiagWriteFlags  fl = fNone 
) const

◆ x_OldWrite()

CNcbiOstream & SDiagMessage::x_OldWrite ( CNcbiOstream os,
TDiagWriteFlags  fl = fNone 
) const

◆ x_ParseExtraArgs()

bool SDiagMessage::x_ParseExtraArgs ( const string str,
size_t  pos 
)
private

◆ x_PrintMessage()

void CDiagContext::x_PrintMessage ( SDiagMessage::EEventType  event,
const string message 
)
private

◆ x_Put()

const CNcbiDiag & CNcbiDiag::x_Put ( const CException ex) const
private

◆ x_Release()

void CDiagContext_Extra::x_Release ( void  )
private

◆ x_ResetHandler()

void CFileDiagHandler::x_ResetHandler ( CStreamDiagHandler_Base **  ptr,
bool owned 
)
private

◆ x_ResetPassThroughProp()

void CRequestContext::x_ResetPassThroughProp ( CTempString  name,
bool  update 
) const
private

◆ x_SaveContextData()

void SDiagMessage::x_SaveContextData ( void  ) const
private

◆ x_SerializeUrlEncoded()

string CRequestContext_PassThrough::x_SerializeUrlEncoded ( void  ) const
private

◆ x_SetFormat()

void SDiagMessage::x_SetFormat ( EFormatFlag  fmt) const
inlineprivate

Definition at line 1743 of file ncbidiag.hpp.

References SDiagMessage::m_Format.

◆ x_SetHandler()

void CFileDiagHandler::x_SetHandler ( CStreamDiagHandler_Base **  member,
bool own_member,
CStreamDiagHandler_Base handler,
bool  own 
)
private

◆ x_SetHitID()

void CRequestContext::x_SetHitID ( const CSharedHitId hit_id)
private

◆ x_SetHitId()

void CSharedHitId::x_SetHitId ( const string hit_id)
private

◆ x_SetPassThroughProp()

void CRequestContext::x_SetPassThroughProp ( CTempString  name,
CTempString  value,
bool  update 
) const
private

◆ x_SetProp()

void CRequestContext::x_SetProp ( EProperty  prop)
inlineprivate

◆ x_StartRequest()

void CDiagContext::x_StartRequest ( void  )
staticprivate

◆ x_TranslateFacility()

int CSysLog::x_TranslateFacility ( EFacility  facility)
private

◆ x_TranslateFlags()

int CSysLog::x_TranslateFlags ( TFlags  flags)
staticprivate

◆ x_UnsetProp()

void CRequestContext::x_UnsetProp ( EProperty  prop)
inlineprivate

◆ x_UpdateStdContextProp()

void CRequestContext::x_UpdateStdContextProp ( CTempString  name) const
private

◆ x_UpdateStdPassThroughProp()

void CRequestContext::x_UpdateStdPassThroughProp ( CTempString  name) const
private

◆ x_UpdateSubHitID()

void CRequestContext::x_UpdateSubHitID ( bool  increment,
CTempString  prefix 
)
private

◆ ~CAsyncDiagHandler()

CAsyncDiagHandler::~CAsyncDiagHandler ( void  )
virtual

Definition at line 7213 of file ncbidiag.cpp.

References _ASSERT, and CAsyncDiagHandler::m_AsyncThread.

◆ ~CDiagAutoPrefix()

CDiagAutoPrefix::~CDiagAutoPrefix ( void  )

Remove the prefix automagically, when the object gets out of scope.

Definition at line 6019 of file ncbidiag.cpp.

References PopDiagPostPrefix().

◆ ~CDiagCollectGuard()

CDiagCollectGuard::~CDiagCollectGuard ( void  )

Destroy the guard, return post level to the one set before the guard initialization.

Depending on the currently set action print or discard the messages. On ePrint all collected messages are printed (if there is no higher level guard) and removed from the collection. On eDiscard the messages are silently discarded (only when the last of several nested guards is destroyed).

Definition at line 569 of file ncbidiag.cpp.

References CDiagCollectGuard::Release().

◆ ~CDiagCompileInfo()

CDiagCompileInfo::~CDiagCompileInfo ( void  )

◆ ~CDiagContext()

CDiagContext::~CDiagContext ( void  )

Definition at line 1337 of file ncbidiag.cpp.

References NULL, and CDiagContext::sm_Instance.

◆ ~CDiagContext_Extra()

CDiagContext_Extra::~CDiagContext_Extra ( void  )

Prints all arguments as "name1=value1&name2=value2...".

Definition at line 2436 of file ncbidiag.cpp.

References CDiagContext_Extra::m_Counter, and CDiagContext_Extra::x_Release().

◆ ~CDiagErrCodeInfo()

CDiagErrCodeInfo::~CDiagErrCodeInfo ( void  )

Destructor.

◆ ~CDiagFactory()

virtual CDiagFactory::~CDiagFactory ( )
inlinevirtual

Definition at line 2927 of file ncbidiag.hpp.

◆ ~CDiagHandler()

virtual CDiagHandler::~CDiagHandler ( void  )
inlinevirtual

Destructor.

Definition at line 2447 of file ncbidiag.hpp.

◆ ~CDiagRestorer()

CDiagRestorer::~CDiagRestorer ( void  )

◆ ~CFileDiagHandler()

CFileDiagHandler::~CFileDiagHandler ( void  )

◆ ~CFileHandleDiagHandler()

CFileHandleDiagHandler::~CFileHandleDiagHandler ( void  )

◆ ~CJaegerTracer()

CJaegerTracer::~CJaegerTracer ( void  )

Definition at line 108 of file jaeger_tracer.cpp.

◆ ~CNcbiDiag()

CNcbiDiag::~CNcbiDiag ( void  )

Destructor.

Definition at line 7732 of file ncbidiag.cpp.

References CNcbiDiag::m_Buffer.

◆ ~CNcbiLogFields()

CNcbiLogFields::~CNcbiLogFields ( void  )

Definition at line 3916 of file ncbidiag.cpp.

◆ ~CPerfLogger()

CPerfLogger::~CPerfLogger ( )
inline

If the timer is still active, then post an error (once).

Usually each measurement should be finished with calling Post() or Discard() method.

Definition at line 475 of file perf_log.hpp.

References ERR_POST_ONCE, Error(), CStopWatch::eStop, CPerfLogger::IsON(), CPerfLogger::m_IsDiscarded, and CPerfLogger::m_TimerState.

◆ ~CPerfLogGuard()

CPerfLogGuard::~CPerfLogGuard ( )
inline

If Post() or Discard() have not been called, then log the collected info with status 500.

Definition at line 538 of file perf_log.hpp.

References CRequestStatus::e500_InternalServerError, CPerfLogger::m_IsDiscarded, CPerfLogGuard::m_Logger, and CPerfLogGuard::Post().

◆ ~CRequestContext()

CRequestContext::~CRequestContext ( void  )
virtual

Definition at line 185 of file request_ctx.cpp.

◆ ~CRequestContextGuard_Base()

CRequestContextGuard_Base::~CRequestContextGuard_Base ( void  )

◆ ~CSharedHitId()

CSharedHitId::~CSharedHitId ( void  )
inline

Definition at line 75 of file request_ctx.hpp.

◆ ~CSysLog()

CSysLog::~CSysLog ( )

Definition at line 88 of file syslog.cpp.

References NULL, and CSysLog::sm_Current.

◆ ~INextDiagMessage()

virtual INextDiagMessage::~INextDiagMessage ( void  )
inlinevirtual

Definition at line 1578 of file ncbidiag.hpp.

◆ ~IRequestTracer()

virtual IRequestTracer::~IRequestTracer ( void  )
inlinevirtual

Definition at line 144 of file request_ctx.hpp.

◆ ~ITracerSpan()

virtual ITracerSpan::~ITracerSpan ( void  )
inlinevirtual

Definition at line 153 of file request_ctx.hpp.

◆ ~SDiagMessage()

SDiagMessage::~SDiagMessage ( void  )

Definition at line 4574 of file ncbidiag.cpp.

References SDiagMessage::m_Data.

Variable Documentation

◆ key

const char* SNcbiLog_Param::key

◆ kLogName_Syslog

const char * CSysLog::kLogName_Syslog = "SYSLOG"
static

Definition at line 110 of file syslog.hpp.

Referenced by CSysLog::GetLogName(), and CDiagContext::SetupDiag().

◆ kProperty_AppName

const char * CDiagContext::kProperty_AppName = "app_name"
static

◆ kProperty_AppState

const char * CDiagContext::kProperty_AppState = "app_state"
static

Per-thread properties.

Definition at line 2059 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_BytesRd

const char * CDiagContext::kProperty_BytesRd = "bytes_rd"
static

Definition at line 2064 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_BytesWr

const char * CDiagContext::kProperty_BytesWr = "bytes_wr"
static

Definition at line 2065 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_ClientIP

const char * CDiagContext::kProperty_ClientIP = "client_ip"
static

Definition at line 2060 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_ExitCode

const char * CDiagContext::kProperty_ExitCode = "exit_code"
static

◆ kProperty_ExitSig

const char * CDiagContext::kProperty_ExitSig = "exit_signal"
static

◆ kProperty_HostIP

const char * CDiagContext::kProperty_HostIP = "host_ip_addr"
static

◆ kProperty_HostName

const char * CDiagContext::kProperty_HostName = "host"
static

◆ kProperty_ReqStatus

const char * CDiagContext::kProperty_ReqStatus = "request_status"
static

Definition at line 2062 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_ReqTime

const char * CDiagContext::kProperty_ReqTime = "request_time"
static

Definition at line 2063 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_SessionID

const char * CDiagContext::kProperty_SessionID = "session_id"
static

Definition at line 2061 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().

◆ kProperty_UserName

const char * CDiagContext::kProperty_UserName = "user"
static

Global properties.

Definition at line 2052 of file ncbidiag.hpp.

Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().

◆ m_Action

EAction CDiagCollectGuard::m_Action
private

◆ m_Adjustment

double CPerfLogger::m_Adjustment
private

◆ m_AllowBadExtraNames

bool SDiagMessage::m_AllowBadExtraNames
private

◆ m_AllowBadNames

bool CDiagContext_Extra::m_AllowBadNames
private

◆ m_AppLogRC

unique_ptr<CRequestRateControl> CDiagContext::m_AppLogRC
private

◆ m_ApplogSeverityLocked

bool CDiagRestorer::m_ApplogSeverityLocked
private

Limiting applog post level?

Definition at line 2983 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_AppLogSuspended

atomic<bool> CDiagContext::m_AppLogSuspended
private

◆ m_AppName

unique_ptr<CEncodedString> CDiagContext::m_AppName
private

◆ m_AppNameSet

bool CDiagContext::m_AppNameSet
mutableprivate

◆ m_AppState [1/3]

EDiagAppState CDiagContext::m_AppState
private

◆ m_AppState [2/3]

EDiagAppState CSharedHitId::m_AppState
private

Definition at line 134 of file request_ctx.hpp.

Referenced by CSharedHitId::IsRequestLevel(), and CSharedHitId::SetHitId().

◆ m_AppState [3/3]

EDiagAppState CRequestContext::m_AppState
private

◆ m_Args

TExtraArgs* CDiagContext_Extra::m_Args
private

◆ m_AsyncThread

CAsyncDiagThread* CAsyncDiagHandler::m_AsyncThread
private

◆ m_AutoIncOnPost

bool CRequestContext::m_AutoIncOnPost
private

◆ m_Buffer [1/2]

CDiagBuffer& CNcbiDiag::m_Buffer
private

This thread's error msg. buffer.

Definition at line 1210 of file ncbidiag.hpp.

Referenced by CNcbiDiag::x_Put(), and CNcbiDiag::~CNcbiDiag().

◆ m_Buffer [2/2]

const char* SDiagMessage::m_Buffer

◆ m_BufferLen

size_t SDiagMessage::m_BufferLen

◆ m_BytesRd

Int8 CRequestContext::m_BytesRd
private

◆ m_BytesWr

Int8 CRequestContext::m_BytesWr
private

◆ m_CanDeleteErrCodeInfo

bool CDiagRestorer::m_CanDeleteErrCodeInfo
private

Can delete err code info?

Definition at line 2982 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_CanDeleteHandler

bool CDiagRestorer::m_CanDeleteHandler
private

Can handler be deleted?

Definition at line 2980 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_Class [1/2]

const char* MDiagClass::m_Class
private

Definition at line 889 of file ncbidiag.hpp.

◆ m_Class [2/2]

const char* SDiagMessage::m_Class

◆ m_ClassName

string CDiagCompileInfo::m_ClassName
mutableprivate

◆ m_ClassSet

bool CDiagCompileInfo::m_ClassSet
mutableprivate

Definition at line 115 of file ncbidiag.hpp.

Referenced by CDiagCompileInfo::SetClass(), and CDiagCompileInfo::SetFunction().

◆ m_ClientIP

string CRequestContext::m_ClientIP
private

◆ m_Code

int ErrCode::m_Code

Major error code number.

Definition at line 821 of file ncbidiag.hpp.

Referenced by operator<<().

◆ m_CollectSev

EDiagSev CDiagCollectGuard::m_CollectSev
private

◆ m_CompileInfo

CDiagCompileInfo CNcbiDiag::m_CompileInfo
mutableprivate

◆ m_Context

CRef<CRequestContext> CRequestContext_PassThrough::m_Context
private

◆ m_Counter

int* CDiagContext_Extra::m_Counter
private

◆ m_CurrFunctName

const char* CDiagCompileInfo::m_CurrFunctName
private

◆ m_Data

SDiagMessageData* SDiagMessage::m_Data
mutableprivate

◆ m_DefaultFacility

int CSysLog::m_DefaultFacility
private

◆ m_DefaultHitId

unique_ptr<CSharedHitId> CDiagContext::m_DefaultHitId
mutableprivate

◆ m_DefaultSessionId

unique_ptr<CEncodedString> CDiagContext::m_DefaultSessionId
mutableprivate

Definition at line 2360 of file ncbidiag.hpp.

Referenced by CDiagContext::SetDefaultSessionID().

◆ m_DieSeverity

EDiagSev CDiagRestorer::m_DieSeverity
private

Die level severity.

Definition at line 2976 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_Dtab

string CRequestContext::m_Dtab
private

◆ m_Elapsed

double CPerfLogger::m_Elapsed
private

◆ m_Err

CStreamDiagHandler_Base* CFileDiagHandler::m_Err
private

◆ m_ErrCode [1/2]

int CNcbiDiag::m_ErrCode
mutableprivate

Error code.

Definition at line 1208 of file ncbidiag.hpp.

◆ m_ErrCode [2/2]

int SDiagMessage::m_ErrCode

◆ m_ErrCodeInfo

CDiagErrCodeInfo* CDiagRestorer::m_ErrCodeInfo
private

Error code information.

Definition at line 2981 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_ErrLogRC

unique_ptr<CRequestRateControl> CDiagContext::m_ErrLogRC
private

◆ m_ErrLogSuspended

atomic<bool> CDiagContext::m_ErrLogSuspended
private

◆ m_ErrorStatus

int CRequestContextGuard_Base::m_ErrorStatus = 500
private

◆ m_ErrSubCode [1/2]

int CNcbiDiag::m_ErrSubCode
mutableprivate

Error subcode.

Definition at line 1209 of file ncbidiag.hpp.

◆ m_ErrSubCode [2/2]

int SDiagMessage::m_ErrSubCode

◆ m_ErrText

const char* SDiagMessage::m_ErrText

Sometimes 'error' has no numeric code, but can be represented as text.

Definition at line 1663 of file ncbidiag.hpp.

Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ m_Event

EEventType SDiagMessage::m_Event

◆ m_EventType

SDiagMessage::EEventType CDiagContext_Extra::m_EventType
private

Definition at line 1918 of file ncbidiag.hpp.

Referenced by CDiagContext_Extra::Flush(), and CDiagContext_Extra::x_CanPrint().

◆ m_ExitCode

int CDiagContext::m_ExitCode
private

◆ m_ExitCodeSet

bool CDiagContext::m_ExitCodeSet
private

Definition at line 2364 of file ncbidiag.hpp.

Referenced by CDiagContext::IsSetExitCode(), and CDiagContext::SetExitCode().

◆ m_ExitSig

int CDiagContext::m_ExitSig
private

◆ m_Explanation

string SDiagErrCodeDescription::m_Explanation

Error message (with detailed explanation)

Definition at line 3014 of file ncbidiag.hpp.

Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ m_ExtraArgs

TExtraArgs SDiagMessage::m_ExtraArgs

◆ m_Fields

TFields CNcbiLogFields::m_Fields
private

Definition at line 2423 of file ncbidiag.hpp.

Referenced by CNcbiLogFields::CNcbiLogFields(), and CNcbiLogFields::x_Match().

◆ m_File [1/2]

const char* CDiagCompileInfo::m_File
private

◆ m_File [2/2]

const char* SDiagMessage::m_File

◆ m_FileType

EDiagFileType CFileHandleDiagHandler::m_FileType
private

Definition at line 2674 of file ncbidiag.hpp.

Referenced by CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::Valid().

◆ m_FirstStartTime

CTime CPerfLogger::m_FirstStartTime
private

◆ m_Flags [1/5]

TDiagPostFlags SetPostFlags::m_Flags

flags to set

Definition at line 852 of file ncbidiag.hpp.

◆ m_Flags [2/5]

TDiagPostFlags SDiagMessage::m_Flags

◆ m_Flags [3/5]

TContextFlags CRequestContext::m_Flags
private

Definition at line 480 of file request_ctx.hpp.

Referenced by CRequestContext::Clone(), and CRequestContext::StartRequest().

◆ m_Flags [4/5]

TFlags CRequestContextGuard_Base::m_Flags = 0
private

◆ m_Flags [5/5]

TFlags CSysLog::m_Flags
private

Definition at line 122 of file syslog.hpp.

Referenced by CSysLog::HonorRegistrySettings(), CSysLog::Post(), and CSysLog::x_Connect().

◆ m_Flushed

bool CDiagContext_Extra::m_Flushed
private

◆ m_Format

EFormatFlag SDiagMessage::m_Format
mutableprivate

◆ m_Function [1/2]

const char* MDiagFunction::m_Function
private

Definition at line 907 of file ncbidiag.hpp.

◆ m_Function [2/2]

const char* SDiagMessage::m_Function

◆ m_FunctName

string CDiagCompileInfo::m_FunctName
mutableprivate

◆ m_Handle

CDiagFileHandleHolder* CFileHandleDiagHandler::m_Handle
private

◆ m_HandleLock

CSpinLock* CFileHandleDiagHandler::m_HandleLock
private

◆ m_Handler

CDiagHandler* CDiagRestorer::m_Handler
private

Class handler.

Definition at line 2979 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_HavePosts

bool CFileHandleDiagHandler::m_HavePosts
private

◆ m_HitId

string CSharedHitId::m_HitId
private

◆ m_HitID

CSharedHitId CRequestContext::m_HitID
private

◆ m_HitIDLoggedFlag

int CRequestContext::m_HitIDLoggedFlag
mutableprivate

◆ m_Host

unique_ptr<CEncodedString> CDiagContext::m_Host
mutableprivate

◆ m_HostIP

string CDiagContext::m_HostIP
private

◆ m_Ident

string CSysLog::m_Ident
private

Definition at line 121 of file syslog.hpp.

Referenced by CSysLog::x_Connect().

◆ m_IgnoreToDie

bool CDiagRestorer::m_IgnoreToDie
private

Ignore to die on die sev.

Definition at line 2975 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_Info

TInfo CDiagErrCodeInfo::m_Info
private

Map storing error codes and descriptions.

Definition at line 3086 of file ncbidiag.hpp.

Referenced by CDiagErrCodeInfo::GetDescription().

◆ m_IsDiscarded

bool CPerfLogger::m_IsDiscarded
private

◆ m_IsReadOnly

bool CRequestContext::m_IsReadOnly
private

◆ m_IsRunning

bool CRequestContext::m_IsRunning
private

◆ m_LastStartTime

CTime CPerfLogger::m_LastStartTime
private

◆ m_Level

EDiagSev Severity::m_Level

Severity level.

Definition at line 837 of file ncbidiag.hpp.

◆ m_Line [1/2]

int CDiagCompileInfo::m_Line
private

Definition at line 111 of file ncbidiag.hpp.

Referenced by CDiagCompileInfo::SetLine().

◆ m_Line [2/2]

size_t SDiagMessage::m_Line

◆ m_Log

CStreamDiagHandler_Base* CFileDiagHandler::m_Log
private

◆ m_LoggedHitId

bool CDiagContext::m_LoggedHitId
mutableprivate

◆ m_Logger

CPerfLogger CPerfLogGuard::m_Logger
private

◆ m_LogName

char CStreamDiagHandler_Base::m_LogName[2048]
private

◆ m_LowDiskSpace

bool CFileHandleDiagHandler::m_LowDiskSpace
private

Definition at line 2676 of file ncbidiag.hpp.

Referenced by CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::Valid().

◆ m_MaxMessages

size_t CDiagContext::m_MaxMessages
private

Definition at line 2370 of file ncbidiag.hpp.

Referenced by CDiagContext::InitMessages(), and CDiagContext::PushMessage().

◆ m_Message

string SDiagErrCodeDescription::m_Message

Error message (short)

Definition at line 3013 of file ncbidiag.hpp.

Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ m_Messages [1/2]

unique_ptr<TMessages> CDiagContext::m_Messages
private

◆ m_Messages [2/2]

unique_ptr<TMessages> CFileHandleDiagHandler::m_Messages
private

Definition at line 2683 of file ncbidiag.hpp.

Referenced by CFileHandleDiagHandler::Post(), and CFileHandleDiagHandler::Reopen().

◆ m_Module [1/3]

const char* CDiagCompileInfo::m_Module
private

◆ m_Module [2/3]

const char* MDiagModule::m_Module
private

Definition at line 871 of file ncbidiag.hpp.

◆ m_Module [3/3]

const char* SDiagMessage::m_Module

◆ m_NoTee

bool SDiagMessage::m_NoTee

Special flag indicating that the message should not be printed by Tee-handler.

Definition at line 1685 of file ncbidiag.hpp.

Referenced by CTeeDiagHandler::Post().

◆ m_OmitStackTrace

bool CNcbiDiag::m_OmitStackTrace
mutableprivate

◆ m_OriginatesFromThrow

bool CRequestContextGuard_Base::m_OriginatesFromThrow = false
private

◆ m_OwnErr

bool CFileDiagHandler::m_OwnErr
private

◆ m_OwnerTID

Uint8 CRequestContext::m_OwnerTID
private

Definition at line 486 of file request_ctx.hpp.

Referenced by CDiagContextThreadData::SetRequestContext().

◆ m_OwnLog

bool CFileDiagHandler::m_OwnLog
private

◆ m_OwnPerf

bool CFileDiagHandler::m_OwnPerf
private

◆ m_OwnTrace

bool CFileDiagHandler::m_OwnTrace
private

◆ m_Parameters

SDiagMessage::TExtraArgs CPerfLogGuard::m_Parameters
private

Definition at line 336 of file perf_log.hpp.

Referenced by CPerfLogGuard::AddParameter(), and CPerfLogGuard::Post().

◆ m_Parsed

bool CDiagCompileInfo::m_Parsed
mutableprivate

◆ m_PassThroughProperties

TPassThroughProperties CRequestContext::m_PassThroughProperties
mutableprivate

◆ m_Perf

CStreamDiagHandler_Base* CFileDiagHandler::m_Perf
private

◆ m_PerfStatus

int CDiagContext_Extra::m_PerfStatus
private

Definition at line 1923 of file ncbidiag.hpp.

Referenced by CDiagContext_Extra::Flush(), and CDiagContext_Extra::operator=().

◆ m_PerfTime

double CDiagContext_Extra::m_PerfTime
private

Definition at line 1924 of file ncbidiag.hpp.

Referenced by CDiagContext_Extra::Flush(), and CDiagContext_Extra::operator=().

◆ m_PID

TPID SDiagMessage::m_PID

◆ m_PostFlags [1/2]

TDiagPostFlags CNcbiDiag::m_PostFlags
mutableprivate

Bitwise OR of "EDiagPostFlag".

Definition at line 1211 of file ncbidiag.hpp.

Referenced by CNcbiDiag::ResetIsConsoleFlag(), and CNcbiDiag::ResetIsNoteFlag().

◆ m_PostFlags [2/2]

TDiagPostFlags CDiagRestorer::m_PostFlags
private

Post flags.

Definition at line 2972 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_PostPrefix

string CDiagRestorer::m_PostPrefix
private

Message prefix.

Definition at line 2970 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_PostSeverity

EDiagSev CDiagRestorer::m_PostSeverity
private

Post severity.

Definition at line 2973 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_PostSeverityChange

EDiagSevChange CDiagRestorer::m_PostSeverityChange
private

Severity change.

Definition at line 2974 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_Prefix

const char* SDiagMessage::m_Prefix

◆ m_PrefixList

list<string> CDiagRestorer::m_PrefixList
private

List of prefixes.

Definition at line 2971 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_PrintSev

EDiagSev CDiagCollectGuard::m_PrintSev
private

◆ m_PrintStackTrace

bool SDiagMessage::m_PrintStackTrace

Definition at line 1687 of file ncbidiag.hpp.

Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ m_ProcPost

TCount SDiagMessage::m_ProcPost

Number of the post in the process.

Definition at line 1667 of file ncbidiag.hpp.

Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().

◆ m_Properties [1/2]

TProperties CDiagContext::m_Properties
private

◆ m_Properties [2/2]

TProperties CRequestContext::m_Properties
private

◆ m_PropSet

TPropSet CRequestContext::m_PropSet
private

◆ m_QuickFlush

bool CStreamDiagHandler::m_QuickFlush
private

Quick flush of stream flag.

Definition at line 2618 of file ncbidiag.hpp.

Referenced by CStreamDiagHandler::Post().

◆ m_ReopenTimer [1/2]

CStopWatch* CFileHandleDiagHandler::m_ReopenTimer
private

◆ m_ReopenTimer [2/2]

CStopWatch* CFileDiagHandler::m_ReopenTimer
private

◆ m_ReqStatus

int CRequestContext::m_ReqStatus
private

◆ m_ReqTimer

CStopWatch CRequestContext::m_ReqTimer
private

◆ m_RequestContext

CRef<CRequestContext> CRequestContextGuard_Base::m_RequestContext
mutableprivate

◆ m_RequestId

TCount SDiagMessage::m_RequestId

FastCGI iteration or request ID.

Definition at line 1669 of file ncbidiag.hpp.

Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().

◆ m_RequestID

TCount CRequestContext::m_RequestID
private

◆ m_Resource

string CPerfLogGuard::m_Resource
private

Definition at line 335 of file perf_log.hpp.

Referenced by CPerfLogGuard::Post().

◆ m_SavedContext

CRef<CRequestContext> CRequestContextGuard_Base::m_SavedContext
private

◆ m_SessionID

CEncodedString CRequestContext::m_SessionID
private

◆ m_Severity [1/3]

EDiagSev CNcbiDiag::m_Severity
mutableprivate

Severity level of current msg.

Definition at line 1207 of file ncbidiag.hpp.

◆ m_Severity [2/3]

EDiagSev SDiagMessage::m_Severity
mutable

◆ m_Severity [3/3]

int SDiagErrCodeDescription::m_Severity

Message severity (if less that 0, then use current diagnostic severity level)

Definition at line 3015 of file ncbidiag.hpp.

Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().

◆ m_SeverityCap

EDiagSev CDiagCollectGuard::m_SeverityCap
private

◆ m_SharedSubHitId

CRef<TSharedCounter> CSharedHitId::m_SharedSubHitId
mutableprivate

◆ m_Source

string CNcbiLogFields::m_Source
private

Definition at line 2422 of file ncbidiag.hpp.

Referenced by CNcbiLogFields::x_Match().

◆ m_Span

shared_ptr<jaegertracing::Span> CJaegerTracerSpan::m_Span
private

Definition at line 60 of file jaeger_tracer.hpp.

Referenced by CJaegerTracerSpan::GetSpan().

◆ m_StartingPoint

Uint8 CDiagCollectGuard::m_StartingPoint
private

◆ m_StopWatch [1/2]

unique_ptr<CStopWatch> CDiagContext::m_StopWatch
private

Definition at line 2368 of file ncbidiag.hpp.

Referenced by CDiagContext::x_PrintMessage().

◆ m_StopWatch [2/2]

CStopWatch* CPerfLogger::m_StopWatch
private

◆ m_StrCurrFunctName

string CDiagCompileInfo::m_StrCurrFunctName
private

◆ m_Stream

CNcbiOstream* CStreamDiagHandler::m_Stream
protected

◆ m_StrFile

string CDiagCompileInfo::m_StrFile
private

◆ m_StrModule

string CDiagCompileInfo::m_StrModule
private

Definition at line 121 of file ncbidiag.hpp.

Referenced by CDiagCompileInfo::SetModule().

◆ m_SubCode

int ErrCode::m_SubCode

Minor error code number.

Definition at line 822 of file ncbidiag.hpp.

Referenced by operator<<().

◆ m_SubHitId

TSubHitId CSharedHitId::m_SubHitId
private

◆ m_SubHitIDCache

string CRequestContext::m_SubHitIDCache
private

◆ m_ThreadSuffix

string CAsyncDiagHandler::m_ThreadSuffix
private

◆ m_ThrPost

TCount SDiagMessage::m_ThrPost

Number of the post in the thread.

Definition at line 1668 of file ncbidiag.hpp.

Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().

◆ m_TID

TTID SDiagMessage::m_TID

◆ m_TimerState

CStopWatch::EStart CPerfLogger::m_TimerState
private

◆ m_Trace

CStreamDiagHandler_Base* CFileDiagHandler::m_Trace
private

◆ m_TraceDefault

EDiagTrace CDiagRestorer::m_TraceDefault
private

Default trace setting.

Definition at line 2977 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_TraceEnabled

bool CDiagRestorer::m_TraceEnabled
private

Trace enabled?

Definition at line 2978 of file ncbidiag.hpp.

Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().

◆ m_TraceLogRC

unique_ptr<CRequestRateControl> CDiagContext::m_TraceLogRC
private

◆ m_TraceLogSuspended

atomic<bool> CDiagContext::m_TraceLogSuspended
private

◆ m_Tracer

shared_ptr<IRequestTracer> CRequestContext::m_Tracer
private

◆ m_TracerSpan

shared_ptr<ITracerSpan> CRequestContext::m_TracerSpan
private

◆ m_Typed

bool CDiagContext_Extra::m_Typed
private

◆ m_TypedExtra

bool SDiagMessage::m_TypedExtra

Set to true if this is a typed extra message (the arguments include "NCBIEXTRATYPE=<extra-type>").

Definition at line 1681 of file ncbidiag.hpp.

Referenced by CDiagContext_Extra::Flush(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), and SDiagMessage::x_ParseExtraArgs().

◆ m_UID

TUID CDiagContext::m_UID
mutableprivate

◆ m_Username

unique_ptr<CEncodedString> CDiagContext::m_Username
private

Definition at line 2357 of file ncbidiag.hpp.

Referenced by CDiagContext::GetUsername(), and CDiagContext::SetUsername().

◆ m_Version

TVersion CRequestContext::m_Version
private

Definition at line 488 of file request_ctx.hpp.

Referenced by CRequestContext::GetVersion(), and CRequestContext::x_Modify().

◆ sm_ApplogSeverityLocked

bool CDiagContext::sm_ApplogSeverityLocked = false
staticprivate

◆ sm_ContextFields

unique_ptr< CMaskFileName > CRequestContext::sm_ContextFields
staticprivate

Definition at line 502 of file request_ctx.hpp.

Referenced by CRequestContext::sx_GetContextFieldsMask().

◆ sm_Current

CSysLog * CSysLog::sm_Current = NULL
staticprivate

◆ sm_EnvContextProperties

unique_ptr< CRequestContext::TPassThroughProperties > CRequestContext::sm_EnvContextProperties
staticprivate

Definition at line 505 of file request_ctx.hpp.

Referenced by CRequestContext::x_LoadEnvContextProperties().

◆ sm_Instance

CDiagContext * CDiagContext::sm_Instance = NULL
staticprivate

◆ sm_PID

CDiagContext::TPID CDiagContext::sm_PID = 0
staticprivate

Definition at line 2352 of file ncbidiag.hpp.

Referenced by CDiagContext::GetPID(), and CDiagContext::UpdatePID_AsyncSafe().

◆ sm_VersionCounter

CAtomicCounter CRequestContext::sm_VersionCounter
staticprivate

Definition at line 507 of file request_ctx.hpp.

Referenced by CRequestContext::x_Modify().

◆ value

const char* SNcbiLog_Param::value

Friends

◆ CDiagBuffer [1/2]

friend class CDiagBuffer
friend

Definition at line 2331 of file ncbidiag.hpp.

◆ CDiagBuffer [2/2]

friend class CDiagBuffer
friend

Definition at line 452 of file request_ctx.hpp.

◆ CDiagContext [1/3]

friend class CDiagContext
friend

Definition at line 1745 of file ncbidiag.hpp.

◆ CDiagContext [2/3]

friend class CDiagContext
friend

Definition at line 1912 of file ncbidiag.hpp.

◆ CDiagContext [3/3]

friend class CDiagContext
friend

Definition at line 395 of file request_ctx.hpp.

◆ CDiagContext_Extra [1/2]

friend class CDiagContext_Extra
friend

Definition at line 1757 of file ncbidiag.hpp.

◆ CDiagContext_Extra [2/2]

friend class CDiagContext_Extra
friend

Definition at line 2320 of file ncbidiag.hpp.

Referenced by CDiagContext::Extra(), and CDiagContext::PrintRequestStart().

◆ CDiagContextThreadData [1/2]

friend class CDiagContextThreadData
friend

Definition at line 2330 of file ncbidiag.hpp.

◆ CDiagContextThreadData [2/2]

friend class CDiagContextThreadData
friend

Definition at line 484 of file request_ctx.hpp.

◆ CNcbiDiag

friend class CNcbiDiag
friend

Definition at line 91 of file ncbidiag.hpp.

◆ Console

const CNcbiDiag& Console ( const CNcbiDiag diag)
friend

Set IsConsole flag to indicate that the current post should go to console regardless of its severity (in addition to the default output – file etc.).

Do not flush current post or change the severity. The flag is reset by the next Flush().

◆ CPerfLogGuard

friend class CPerfLogGuard
friend

Definition at line 173 of file perf_log.hpp.

◆ CRequestContext

friend class CRequestContext
friend

Definition at line 2332 of file ncbidiag.hpp.

◆ CRequestContext_PassThrough

friend class CRequestContext_PassThrough
friend

Definition at line 495 of file request_ctx.hpp.

◆ Critical

const CNcbiDiag& Critical ( const CNcbiDiag diag)
friend

Flush current message, then set a severity for the next diagnostic message to CRITICAL ERROR.

◆ Endm

const CNcbiDiag& Endm ( const CNcbiDiag diag)
friend

Flush current message, start new one.

Referenced by CNcbiDiag::DiagAssert(), CNcbiDiag::DiagFatal(), and CNcbiDiag::DiagTrouble().

◆ Error

const CNcbiDiag& Error ( const CNcbiDiag diag)
friend

Flush current message, then set a severity for the next diagnostic message to ERROR.

◆ Fatal

const CNcbiDiag& Fatal ( const CNcbiDiag diag)
friend

Flush current message, then set a severity for the next diagnostic message to FATAL.

◆ g_PostPerf

CDiagContext_Extra g_PostPerf ( int  status,
double  timespan,
SDiagMessage::TExtraArgs args 
)
friend

Definition at line 8347 of file ncbidiag.cpp.

◆ Info

const CNcbiDiag& Info ( const CNcbiDiag diag)
friend

Flush current message, then set a severity for the next diagnostic message to INFO.

◆ Message

const CNcbiDiag& Message ( const CNcbiDiag diag)
friend

Set IsMessage flag to indicate that the current post is a message.

Do not flush current post or change the severity. The flag is reset by the next Flush().

Deprecated:
Use Note manipulator.

◆ Note

const CNcbiDiag& Note ( const CNcbiDiag diag)
friend

Set IsNote flag to indicate that the current post is a note.

Do not flush current post or change the severity. The flag is reset by the next Flush().

◆ operator<< [1/3]

const CNcbiDiag& operator<< ( const CNcbiDiag diag,
const MDiagClass nclass 
)
friend

◆ operator<< [2/3]

const CNcbiDiag& operator<< ( const CNcbiDiag diag,
const MDiagFunction function 
)
friend

◆ operator<< [3/3]

const CNcbiDiag& operator<< ( const CNcbiDiag diag,
const MDiagModule module 
)
friend

◆ Reset

const CNcbiDiag& Reset ( const CNcbiDiag diag)
friend

Reset the content of current message.

◆ StackTrace

const CNcbiDiag& StackTrace ( const CNcbiDiag diag)
friend

Print stack trace.

◆ Trace

const CNcbiDiag& Trace ( const CNcbiDiag diag)
friend

Flush current message, then set a severity for the next diagnostic message to TRACE.

◆ Warning

const CNcbiDiag& Warning ( const CNcbiDiag diag)
friend

Flush current message, then set a severity for the next diagnostic message to WARNING.

Modified on Tue Apr 23 07:36:47 2024 by modify_doxy.py rev. 669887