NCBI_NS_NCBI::CDiagCompileInfo(__FILE__, \
__LINE__, \
#define NCBI_MAKE_MODULE(module)
Set default module name based on NCBI_MODULE macro.
#define NCBI_CURRENT_FUNCTION
Get current function name.
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" );
Definition at line 170 of file ncbidiag.hpp.
◆ DIAG_MESSAGE_FILE #define DIAG_MESSAGE_FILE "MessageFile" ◆ 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" ◆ ERR_FATAL #define ERR_FATAL ( message ) Value:#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
@ eDiag_Fatal
Fatal error â guarantees exit(or abort)
void EndmFatal(const CNcbiDiag &diag)
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.
Definition at line 240 of file ncbidiag.hpp.
◆ ERR_FATAL_EX #define ERR_FATAL_EX ( err_code, err_subcode, message ) Value:#define ErrCode()
Get the error code for the last failed system function.
Definition at line 266 of file ncbidiag.hpp.
◆ ERR_FATAL_X ◆ ERR_FATAL_XX #define ERR_FATAL_XX ( error_name, err_subcode, message ) Value:message)
#define NCBI_ERRCODE_X_NAME(name)
Returns value of error code by its name defined by NCBI_DEFINE_ERRCODE_X.
#define ERR_FATAL_EX(err_code, err_subcode, message)
#define NCBI_ERR_SUBCODE_X_NAME(name, subcode)
Pass subcode as argument with check of its validity for given error code.
Definition at line 574 of file ncbidiag.hpp.
◆ ERR_POST #define ERR_POST ( message ) ◆ ERR_POST_EX #define ERR_POST_EX ( err_code, err_subcode, message ) Value:<< 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.
Definition at line 252 of file ncbidiag.hpp.
◆ ERR_POST_N_TIMESError posting only given number of times during program execution.
Definition at line 594 of file ncbidiag.hpp.
◆ ERR_POST_ONCEError posting only once during program execution.
Definition at line 602 of file ncbidiag.hpp.
◆ ERR_POST_XError 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.
Definition at line 550 of file ncbidiag.hpp.
◆ ERR_POST_X_N_TIMES ◆ ERR_POST_X_ONCE #define ERR_POST_X_ONCE ( err_subcode, message ) ERR_POST_X_N_TIMES(1, err_subcode, message) ◆ ERR_POST_XX #define ERR_POST_XX ( error_name, err_subcode, message ) Value:message)
#define ERR_POST_EX(err_code, err_subcode, message)
Error posting with error codes.
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.
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.
#define ERR_POST_XX(error_name, err_subcode, message)
Error posting with error code having given name and with given error subcode.
Error posting only given number of times during program execution with given error code name and given error subcode.
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) ◆ INFO_POST ◆ INFO_POST_EX ◆ INFO_POST_X ◆ LOG_POST #define LOG_POST ( message ) Value:<< message \
<< NCBI_NS_NCBI::Endm )
@ eDPF_IsNote
Print "Note[X]" severity name.
@ eDPF_Log
Print the posted message only; without severity, location, prefix, etc.
@ eDiag_Error
Error 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.
Definition at line 226 of file ncbidiag.hpp.
◆ LOG_POST_EX #define LOG_POST_EX ( err_code, err_subcode, message ) Value:<< message \
<< NCBI_NS_NCBI::Endm )
Definition at line 258 of file ncbidiag.hpp.
◆ LOG_POST_N_TIMES ◆ LOG_POST_ONCE ◆ LOG_POST_X ◆ LOG_POST_X_N_TIMES ◆ LOG_POST_X_ONCE ◆ LOG_POST_XX #define LOG_POST_XX ( error_name, err_subcode, message ) Value:message)
#define LOG_POST_EX(err_code, err_subcode, message)
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 at line 635 of file ncbidiag.hpp.
◆ LOG_POST_XX_ONCE ◆ NCBI_CHECK_ERR_SUBCODE_XIssue 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< \
((unsigned int)subcode > \
>) \
)
void CheckErrSubcodeX(int)
Additional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro.
#define NCBI_MAX_ERR_SUBCODE_X_NAME(name)
Returns maximum value of error subcode within error code with given name.
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).
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> \
) \
{}
#define NCBI_NAME2(Name1, Name2)
Name concatenation macro with two names.
Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code.
Definition at line 432 of file ncbidiag.hpp.
◆ NCBI_CURRENT_FUNCTIONGet 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_XDefine 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);
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.
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);
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, \
}; \
}; \
} \
NCBI_EAT_SEMICOLON(err_code)
unsigned int
A callback function used to compare two keys in a database.
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);
Definition at line 297 of file ncbidiag.hpp.
◆ NCBI_ERR_SUBCODE_XPass subcode as argument with check of its validity for current error code.
Definition at line 472 of file ncbidiag.hpp.
◆ NCBI_ERR_SUBCODE_X_NAMEPass subcode as argument with check of its validity for given error code.
Definition at line 468 of file ncbidiag.hpp.
◆ NCBI_ERRCODE_XReturns 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.
Definition at line 376 of file ncbidiag.hpp.
◆ NCBI_ERRCODE_X_NAME ◆ NCBI_MAKE_MODULE ◆ NCBI_MAX_ERR_SUBCODE_X ◆ NCBI_MAX_ERR_SUBCODE_X_NAME ◆ 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; \
} \
} 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 290 of file ncbi_c_log.h.
◆ NCBILOG_UINT8_FORMAT_SPEC #define NCBILOG_UINT8_FORMAT_SPEC "I64u"Definition at line 291 of file ncbi_c_log.h.
◆ PERF_POST #define PERF_POST ( perf_logger, status, resource, args ) Value: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",...
Convenience macro that also saves cycles when the performance logging is globally turned off.
(perf_logger, e200_Ok,
"ApacheSlotStats",
.
Print(
"total_slots",
.
Print(
"used_slots_pct",
.
Print(
"penalty", m_Mode == eShmem ?
"N/A":
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.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static const string BoolToString(bool value)
Convert bool to string.
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 at line 213 of file perf_log.hpp.
◆ PERF_POST_DB #define PERF_POST_DB ( perf_logger, status, resource, server, args ) Value:perf_logger.Post(CRequestStatus::status, resource) \
.Print("dbserver", server) args; \
} while (false)
Adaptation for logging database performance.
"StoredProc123", "MSSQL444")
.Print("foo", "bar"));
#define PERF_POST_DB(perf_logger, status, resource, server, args)
Adaptation for logging database performance.
Definition at line 232 of file perf_log.hpp.
◆ SEVERITY_POST #define SEVERITY_POST ( severity, message ) Value: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...
Wrappers for ERR_POST family of macros checking if the desired severity is enabled.
Definition at line 196 of file ncbidiag.hpp.
◆ SEVERITY_POST_EX #define SEVERITY_POST_EX ( severity, errcode, subcode, message ) Value: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:ERR_POST_X(subcode, severity << message); \
while(0)
Definition at line 203 of file ncbidiag.hpp.
◆ TRACE_POST ◆ TRACE_POST_EX ◆ TRACE_POST_X ◆ WARNING_POST ◆ WARNING_POST_EX ◆ WARNING_POST_X ◆ CSysLogDiagHandler ◆ FAbortHandler typedef void(* FAbortHandler) (void) ◆ FDiagCleanup typedef void(* FDiagCleanup) (void *data) ◆ FDiagHandler ◆ FIosbaseManip typedef IOS_BASE&(* CNcbiDiag::FIosbaseManip) (IOS_BASE &)Definition at line 955 of file ncbidiag.hpp.
◆ FIosManip ◆ FManip ◆ FNcbiLog_MTLock_HandlerMT locking callback.
Definition at line 186 of file ncbi_c_log.h.
◆ TContextFlags ◆ TCount [1/3]Generic type for counters (posts, requests etc.)
Definition at line 1605 of file ncbidiag.hpp.
◆ TCount [2/3] ◆ TCount [3/3] ◆ TDiagPostFlags ◆ TDiagUserAndHost ◆ TDiagWriteFlags ◆ TExtraArg [1/2] ◆ TExtraArg [2/2] ◆ TExtraArgs [1/2] ◆ TExtraArgs [2/2] ◆ TFields ◆ TFlags [1/2] ◆ TFlags [2/2] ◆ TInfo ◆ TMessages [1/2] ◆ TMessages [2/2]Save messages if the handle is unavailable.
Definition at line 2694 of file ncbidiag.hpp.
◆ TNcbiLog_Context ◆ TNcbiLog_Counter ◆ TNcbiLog_Int8 ◆ TNcbiLog_MTLock ◆ TNcbiLog_OnForkFlagsBinary OR of "ENcbiLog_OnForkAction".
Definition at line 454 of file ncbi_c_log.h.
◆ TNcbiLog_PIDProcess, thread and counter types.
Definition at line 302 of file ncbi_c_log.h.
◆ TNcbiLog_TID ◆ TNcbiLog_UInt8 ◆ TOnForkFlags ◆ TParent [1/2] ◆ TParent [2/2] ◆ TPassThroughProperties ◆ TPID [1/2] ◆ TPID [2/2] ◆ TProperties [1/3] ◆ TProperties [2/3] ◆ TProperties [3/3] ◆ TPropSet ◆ TReopenFlags ◆ TSharedCounter ◆ TSpan ◆ TSubHitId ◆ TTID [1/2] ◆ TTID [2/2] ◆ TTracer ◆ TUID [1/2] ◆ TUID [2/2] ◆ TVersion ◆ anonymous enumtemplate<int errorCode, int errorSubcode, int maxErrorSubcode>
◆ anonymous enum ◆ EActionAction to perform in guard's destructor.
Enumerator ePrintPrint all collected messages as is.
eDiscardDiscard collected messages, default.
ePrintCappedPrint collected messages at reduced severity.
Definition at line 1303 of file ncbidiag.hpp.
◆ EAppDiagStreamWhere to write the application's diagnostics to.
Enumerator eDS_ToStdoutTo standard output stream.
eDS_ToStderrTo standard error stream.
eDS_ToStdlogTry standard log file (app.name + ".log") in /log/ and current directory, use stderr if both fail.
eDS_ToMemoryKeep in a temp.memory buffer, see FlushMessages()
eDS_DisableDon't write it anywhere.
eDS_UserLeave as was previously set (or not set) by user.
eDS_AppSpecificCall the application's SetupDiag_AppSpecific()
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
eDS_ToSyslogTo 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_PartialContentBrokenConnectionNon-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 e429_Too_Many_Requests e451_Unavailable_For_Legal_Reasons e499_BrokenConnectionNon-standard status code - used to indicate broken connection while serving normal request.
e500_InternalServerError e501_NotImplemented e502_BadGateway e503_ServiceUnavailable e504_GatewayTimeout e505_HTTPVerNotSupportedDefinition at line 57 of file request_status.hpp.
◆ EContextFlagsRequest context flags.
Enumerator fResetOnStartReset values when printing request-start.
fDefaultDefinition at line 205 of file request_ctx.hpp.
◆ EDefaultHitIDFlags Enumerator eHitID_NoCreate eHitID_CreateDefinition at line 2347 of file ncbidiag.hpp.
◆ EDiagAppStateApplication execution states shown in the std prefix.
Enumerator eDiagAppState_NotSetReserved value, never used in messages.
eDiagAppState_AppBeginAB.
eDiagAppState_AppRunA.
eDiagAppState_AppEndAE.
eDiagAppState_RequestBeginRB.
eDiagAppState_RequestR.
eDiagAppState_RequestEndRE.
Definition at line 789 of file ncbidiag.hpp.
◆ EDiagCollectMessagesFlags to control collecting messages and flushing them to the new destination when switching diag handlers.
Enumerator eDCM_InitStart collecting messages (with limit), do nothing if already initialized.
eDCM_InitNoLimitStart collecting messages without limit (must stop collecting later using eDCM_Flush or eDCM_Discard).
eDCM_NoChangeContinue collecting messages if already started.
eDCM_FlushFlush the collected messages and stop collecting.
eDCM_DiscardDiscard the collected messages without flushing.
Definition at line 1798 of file ncbidiag.hpp.
◆ EDiagFileTypeCDiagHandler –.
Base diagnostic handler class. Type of file for the output
Enumerator eDiagFile_ErrError log file.
eDiagFile_LogAccess log file.
eDiagFile_TraceTrace log file.
eDiagFile_PerfPerf log file.
eDiagFile_AllAll log files.
Definition at line 2446 of file ncbidiag.hpp.
◆ EDiagFilterDiag severity types to put the filter on.
for TRACEs only
eDiagFilter_Postfor all non-TRACE, non-FATAL
eDiagFilter_Allfor all non-FATAL
Definition at line 2540 of file ncbidiag.hpp.
◆ EDiagPostFlagWhich 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:
File name (not full path)
eDPF_LongFilenameFull file path.
eDPF_LineSource line.
eDPF_PrefixPrefix (default)
eDPF_SeveritySeverity (default)
eDPF_ErrorIDError code and subcode (default)
eDPF_DateTimeInclude date and time.
eDPF_ErrCodeMessageError code message (default)
eDPF_ErrCodeExplanationError explanation (default)
eDPF_ErrCodeUseSeverityUse severity from error code (default)
eDPF_LocationInclude class and function if any.
eDPF_TIDThread ID.
eDPF_PIDAll flags (except for the "unusual" ones!)
eDPF_TraceDefault flags to use when tracing.
eDPF_ExceptionDefault flags to use for exception formatting.
eDPF_LogPrint the posted message only; without severity, location, prefix, etc.
eDPF_ErrCodeMsgInFrontPut ErrCode text in front of the message.
eDPF_MergeLinesEscape EOLs.
eDPF_PreMergeLinesObsolete. Use eDPF_MergeLines.
eDPF_OmitInfoSevNo sev. indication if eDiag_Info.
eDPF_OmitSeparatorNo '—' separator before message.
eDPF_AppLogPost message to application log.
eDPF_IsNotePrint "Note[X]" severity name.
eDPF_IsMessage eDPF_AtomicWriteThis flag is deprecated and ignored - all log writes are atomic.
For compatibility IsSetDiagPostFlag always returns true when asked about this flag.
Send the message to 'console' regardless of it's severity.
To be set by 'Console' manipulator only.
eDPF_DefaultUse global default flags (merge with).
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_UseExactUserFlagsUse 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.
◆ EDiagSevSeverity level for the posted diagnostics.
Enumerator eDiag_InfoInformational message.
eDiag_WarningWarning message.
eDiag_ErrorError message.
eDiag_CriticalCritical error message.
eDiag_FatalFatal error – guarantees exit(or abort)
eDiag_TraceTrace message.
eDiagSevMinVerbosity level for min. severity.
eDiagSevMaxVerbosity level for max. severity.
Definition at line 650 of file ncbidiag.hpp.
◆ EDiagSevChangeSeverity level change state.
Enumerator eDiagSC_UnknownStatus of changing severity is unknown (first call)
eDiagSC_DisableDisable change severity level.
eDiagSC_EnableEnable change severity level.
Definition at line 666 of file ncbidiag.hpp.
◆ EDiagTraceWhich setting disables/enables posting of "eDiag_Trace" messages.
By default, trace messages are disabled unless:
Restores the default tracing context.
eDT_DisableIgnore messages of severity "eDiag_Trace".
eDT_EnableEnable messages of severity "eDiag_Trace".
Definition at line 1547 of file ncbidiag.hpp.
◆ EDiagUserAndHostFlags for SetDiagUserAndHost()
Enumerator fDiag_AddUserAdd username to diag context.
fDiag_AddHostAdd hostname to diag context.
fDiag_OverrideExistingSet current user and host even if they are already set.
Definition at line 50 of file ncbi_userhost.hpp.
◆ EDiagWriteFlagsCompose 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 fNoneNo flags.
fNoEndlNo end of line.
fNoPrefixNo std prefix.
Definition at line 1702 of file ncbidiag.hpp.
◆ EDisabledAppLogEventsFlags for disabling groups of applog events with DIAG_DISABLE_APPLOG_MESSAGES.
The global value can be set using DIAG_DISABLE_APPLOG_MESSAGE_TYPES.
Enumerator eDisable_AllDisable all applog events (default).
eEnable_AppAllow only application start/stop.
Definition at line 2308 of file ncbidiag.hpp.
◆ EErrCodeError types that CRequestContext can generate.
These generic error conditions can occur for corelib applications.
Enumerator eBadSessionInvalid session id.
eBadHitInvalid hit id.
Definition at line 701 of file request_ctx.hpp.
◆ EEventTypeType of event to report.
Enumerator eEvent_StartApplication start.
eEvent_StopApplication exit.
eEvent_ExtraOther application events.
eEvent_RequestStartStart processing request.
eEvent_RequestStopFinish processing request.
eEvent_PerfLogPerformance 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 eLocal7Definition at line 74 of file syslog.hpp.
◆ EFlags [1/2] Enumerator fPrintRequestStartPrint request-start automatically in the constructor.
By default request-start is not printed to allow the caller log request arguments.
Definition at line 652 of file request_ctx.hpp.
◆ EFlags [2/2] Enumerator fNoOverridenever call openlog() ourselves
fCopyToStderrmaps to LOG_PERROR if available
fFallBackToConsoleLOG_CONS.
fIncludePIDLOG_PID.
fConnectNowLOG_NDELAY.
fNoChildWaitLOG_NOWAIT.
fAllFlagsDefinition at line 52 of file syslog.hpp.
◆ EFormatSupported serialization/deserialization formats.
Enumerator eFormat_UrlEncodedname=value pairs URL-encoded and separated with '&'
Definition at line 603 of file request_ctx.hpp.
◆ EFormatFlag Enumerator eFormat_Old eFormat_New eFormat_AutoDefinition at line 1738 of file ncbidiag.hpp.
◆ EHitIDSourceHit ID Allowed source of the current hit id.
Any hit id - always return true.
eHitID_RequestCheck if per-request hit id is set.
eHitID_DefaultCheck if default hit id is set.
eHidID_ExistingCheck if any hit is already available (will not be generated on request).
Definition at line 256 of file request_ctx.hpp.
◆ EHttpHeaderType ◆ ELogRate_TypeType of logging rate limit.
Enumerator eLogRate_AppApplication log.
eLogRate_ErrError log.
eLogRate_TraceTrace log.
Definition at line 2276 of file ncbidiag.hpp.
◆ ENcbiLog_AppStateApplication execution states shown in the std prefix.
Reserved value, never used in messages.
eNcbiLog_AppBeginPB.
eNcbiLog_AppRunP.
eNcbiLog_AppEndPE.
eNcbiLog_RequestBeginRB.
eNcbiLog_RequestR.
eNcbiLog_RequestEndRE.
Definition at line 994 of file ncbi_c_log.h.
◆ ENcbiLog_DestinationWhere to write the application's diagnostics to.
Try /log/<*>/<appname>.log; fallback to STDERR.
eNcbiLog_StdlogTry /log/<*>/<appname>.log; fallback to .
/<appname>.log, then to STDERR
eNcbiLog_CwdTry .
/<appname>.log, fallback to STDERR
eNcbiLog_FileTo specific file, see NcbiLog_SetDestinationFile()
eNcbiLog_StdoutTo standard output stream.
eNcbiLog_StderrTo standard error stream.
eNcbiLog_DisableDon't write it anywhere.
Definition at line 246 of file ncbi_c_log.h.
◆ ENcbiLog_MTLock_ActionThe action passed to user defined MT lock handler.
Enumerator eNcbiLog_MT_InitInit the locker (call first)
eNcbiLog_MT_LockLock.
eNcbiLog_MT_UnlockUnlock.
eNcbiLog_MT_DestroyUnlock and cleanup (call last)
Definition at line 152 of file ncbi_c_log.h.
◆ ENcbiLog_MTLock_OwnershipType of ownership for MT lock handle.
Enumerator eNcbiLog_MT_NoOwnershipNo ownership relationship.
eNcbiLog_MT_TakeOwnershipNcbiLog API takes ownership of MT lock.
Definition at line 162 of file ncbi_c_log.h.
◆ ENcbiLog_OnForkActionActions to perform in NcbiLog_UpdateOnFork()
Enumerator fNcbiLog_OnFork_UpdateIDUpdate IDs (default)
fNcbiLog_OnFork_PrintStartLog app-start.
fNcbiLog_OnFork_ResetTimerReset execution timer.
Definition at line 446 of file ncbi_c_log.h.
◆ ENcbiLog_SeveritySeverity level for the posted diagnostics.
Enumerator eNcbiLog_TraceTrace message.
eNcbiLog_InfoInformational message.
eNcbiLog_WarningWarning message.
eNcbiLog_ErrorError message.
eNcbiLog_CriticalCritical error message.
eNcbiLog_FatalFatal error – guarantees exit (or abort)
Definition at line 260 of file ncbi_c_log.h.
◆ EOnBadSessionIDSession ID error actions.
Enumerator eOnBadSID_AllowDon't validate session id.
eOnBadSID_AllowAndReportAccept but show warning (default).
eOnBadSID_IgnoreIgnore bad session id.
eOnBadSID_IgnoreAndReportIgnore and show warning.
eOnBadSID_ThrowThrow on bad session id.
Definition at line 365 of file request_ctx.hpp.
◆ EPostNumberIncrementPost number increment flag for GetProcessPostNumber() and GetThreadPostNumber().
Enumerator ePostNumber_NoIncrementGet post number without incrementing it.
ePostNumber_IncrementIncrement and return the new post number.
Definition at line 1811 of file ncbidiag.hpp.
◆ EPriority Enumerator eEmergency eAlert eCritical eError eWarning eNotice eInfo eDebugDefinition at line 63 of file syslog.hpp.
◆ EProperty Enumerator eProp_RequestID eProp_ClientIP eProp_SessionID eProp_HitID eProp_ReqStatus eProp_BytesRd eProp_BytesWr eProp_DtabDefinition at line 479 of file request_ctx.hpp.
◆ EPropertyModeProperty visibility flag.
Auto-mode for known properties, local for others.
eProp_GlobalThe property is global for the application.
eProp_ThreadThe property has separate value in each thread.
Definition at line 2014 of file ncbidiag.hpp.
◆ EReopenFlags Enumerator fTruncateTruncate file to zero size.
fCheckReopen only if necessary.
fDefaultDefault reopen flags:
Definition at line 2482 of file ncbidiag.hpp.
◆ ESessionIDFormatSession ID format.
Enumerator eSID_NcbiStrict NCBI format: (UID:16)_(RqID:4+)SID.
eSID_StandardAlpanum, underscore, -.:@, (default)
eSID_OtherAny other format.
Definition at line 359 of file request_ctx.hpp.
◆ ESpanAttribute Enumerator eSessionId eClientAddress eClientPort eServerAddress eServerPort eUrl eRequestMethod eUrlScheme eHttpScheme eStatusCode eStatusStringDefinition at line 162 of file request_ctx.hpp.
◆ ESpanKind Enumerator eKind_NotSet eKind_Internal eKind_Server eKind_ClientDefinition at line 155 of file request_ctx.hpp.
◆ ESpanStatus ◆ EStartIf to start the timing immediately.
Enumerator eStartCall Start() immediately after creating.
eSuspendDo not start timer (call Start() later)
Definition at line 83 of file perf_log.hpp.
◆ FLoggedHitIDFlag Enumerator fLoggedOnRequest fLoggedOnErrorDefinition at line 531 of file request_ctx.hpp.
◆ FOnForkActionActions to perform in UpdateOnFork().
Enumerator fOnFork_PrintStartLog app-start.
fOnFork_ResetTimerReset execution timer.
fOnFork_AsyncSafeAfter 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.
◆ Abort()Smart abort function.
Processes user abort handler and does not pop up assert windows if specified (environment variable DIAG_SILENT_ABORT is "Y" or "y").
Definition at line 8254 of file ncbidiag.cpp.
References _TX, abort(), NcbiSys_getenv, s_UserAbortHandler, and rapidjson::value.
Referenced by CNcbiApplicationAPI::AppMain(), CGLFrameBuffer::CheckFBOError(), CGlUtils::CheckGlError(), CCacheBlobStream::Close(), CNcbiDiag::DiagAssert(), CNcbiDiag::DiagFatal(), EndmFatal(), CDiagContextThreadData::GetThreadData(), s_LOG_Handler(), CObject::ThrowNullPointerException(), CObjectException::x_InitErrCode(), and CCacheBlobStream::~CCacheBlobStream().
◆ AddParameter() ◆ AddPassThroughProperty() ◆ Adjust() void CPerfLogger::Adjust ( CTimeSpan timespan ) inline ◆ AllowAsyncWrite() [1/3] ◆ AllowAsyncWrite() [2/3] ◆ AllowAsyncWrite() [3/3] ◆ AllowBadSymbolsInArgNames()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 2315 of file ncbidiag.cpp.
References CDiagContext_Extra::m_AllowBadNames.
◆ AppendDiagFilter() ◆ ApproveMessage()Definition at line 1578 of file ncbidiag.cpp.
References eDiag_Info, eDiag_Trace, eDPF_AppLog, IsSetDiagPostFlag(), CDiagContext::m_AppLogRC, CDiagContext::m_AppLogSuspended, CDiagContext::m_ErrLogRC, CDiagContext::m_ErrLogSuspended, CDiagContext::m_TraceLogRC, CDiagContext::m_TraceLogSuspended, and msg().
◆ CAsyncDiagHandler() CAsyncDiagHandler::CAsyncDiagHandler ( void )Definition at line 7314 of file ncbidiag.cpp.
◆ CDiagAutoPrefix() [1/2] CDiagAutoPrefix::CDiagAutoPrefix ( const char * prefix ) ◆ CDiagAutoPrefix() [2/2] CDiagAutoPrefix::CDiagAutoPrefix ( const string & prefix ) ◆ 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 559 of file ncbidiag.cpp.
References eDiag_Critical, CDiagCollectGuard::eDiscard, and CDiagCollectGuard::x_Init().
◆ CDiagCollectGuard() [2/3]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 566 of file ncbidiag.cpp.
References CDiagCollectGuard::x_Init().
◆ CDiagCollectGuard() [3/3] CDiagCollectGuard::CDiagCollectGuard ( void ) ◆ CDiagCompileInfo() [1/3] ◆ CDiagCompileInfo() [2/3] ◆ CDiagCompileInfo() [3/3] CDiagCompileInfo::CDiagCompileInfo ( void ) ◆ CDiagContext() [1/2] ◆ CDiagContext() [2/2] CDiagContext::CDiagContext ( void ) ◆ CDiagContext_Extra() [1/3]Copying the object will prevent printing it on destruction.
The new copy should take care of printing.
Definition at line 2301 of file ncbidiag.cpp.
◆ CDiagContext_Extra() [2/3] CDiagContext_Extra::CDiagContext_Extra ( int status, double timespan, TExtraArgs & args ) private ◆ CDiagContext_Extra() [3/3] ◆ CDiagErrCodeInfo() [1/3]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 )Captures current settings.
Definition at line 8087 of file ncbidiag.cpp.
References buf, CDiagLock::eWrite, GetDiagBuffer(), CDiagContext::IsApplogSeverityLocked(), CDiagRestorer::m_ApplogSeverityLocked, CDiagRestorer::m_CanDeleteErrCodeInfo, CDiagRestorer::m_CanDeleteHandler, CDiagRestorer::m_DieSeverity, CDiagRestorer::m_ErrCodeInfo, CDiagRestorer::m_Handler, CDiagRestorer::m_IgnoreToDie, CDiagRestorer::m_PostFlags, CDiagRestorer::m_PostPrefix, CDiagRestorer::m_PostSeverity, CDiagRestorer::m_PostSeverityChange, CDiagRestorer::m_PrefixList, CDiagRestorer::m_TraceDefault, and CDiagRestorer::m_TraceEnabled.
◆ CFileDiagHandler() CFileDiagHandler::CFileDiagHandler ( void ) ◆ CFileHandleDiagHandler() ◆ CheckErrSubcodeX() void CheckErrSubcodeX ( int ) inlineAdditional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro.
Definition at line 442 of file ncbidiag.hpp.
◆ CheckFilters() ◆ CJaegerTracer() [1/3] CJaegerTracer::CJaegerTracer ( const string & service_name ) ◆ CJaegerTracer() [2/3] CJaegerTracer::CJaegerTracer ( const string & service_name, const jaegertracing::Config & config ) ◆ CJaegerTracer() [3/3] CJaegerTracer::CJaegerTracer ( void ) ◆ CJaegerTracerSpan() CJaegerTracerSpan::CJaegerTracerSpan ( shared_ptr< jaegertracing::Span > span ) inlineDefinition at line 57 of file jaeger_tracer.hpp.
◆ CleanupTracer() void COpentelemetryTracer::CleanupTracer ( void ) staticUninstall current tracer, if any.
This call is optional but may be useful, e.g. to remove current tracer before the output stream it uses is destroyed.
Definition at line 214 of file opentelemetry_tracer.cpp.
◆ Clear() void CDiagErrCodeInfo::Clear ( void )Delete all stored error descriptions from memory.
◆ Clone()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 592 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_DisabledAppLog, CRequestContext::m_DisabledAppLogEvents, 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]Constructor – includes the file and line number info.
Definition at line 7827 of file ncbidiag.cpp.
◆ CNcbiDiag() [2/3]Private copy constructor to prohibit copy.
◆ CNcbiDiag() [3/3] ◆ CNcbiLogFields() CNcbiLogFields::CNcbiLogFields ( const string & source ) ◆ CompareDiagPostLevel()Compare two severities.
Definition at line 6262 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] ◆ ComposeMessage() [2/3] ◆ ComposeMessage() [3/3] ◆ COpentelemetryTracer() [1/3] COpentelemetryTracer::COpentelemetryTracer ( const string & endpoint ) ◆ COpentelemetryTracer() [2/3] COpentelemetryTracer::COpentelemetryTracer ( ostream & ostr )NOTE: The tracers are global; creating a new tracer replaces any previously installed one.
Export to the output stream. The stream must exist at least until the tracer is deleted.
Definition at line 221 of file opentelemetry_tracer.cpp.
◆ COpentelemetryTracer() [3/3] COpentelemetryTracer::COpentelemetryTracer ( void )Export using exporter settings from the environment/INI file.
The default is to use OTLP/HTTP collector at "http://localhost:4318/v1/traces". The available variables (INI file uses OTEL section, e.g. [OTEL]TRACES_EXPORTER=) and supported values are: OTEL_TRACES_EXPORTER = { otlp, console }, default = otlp OTEL_EXPORTER_OTLP_PROTOCOL = { http/protobuf, http/json, grpc }, default = http/protobuf OTEL_EXPORTER_OTLP_ENDPOINT = URL string, default = http://localhost:4318 for http/*, http://localhost:4317 for grpc
Definition at line 227 of file opentelemetry_tracer.cpp.
◆ COpentelemetryTracerSpan() ◆ CPerfLogger() [1/3] ◆ CPerfLogger() [2/3] ◆ CPerfLogger() [3/3] ◆ CPerfLogGuard() [1/3]Constructor.
Use the provided start and elapsed times to initialize the logger and continue to measure an operation.
Definition at line 511 of file perf_log.hpp.
References CTempString::empty(), and NCBI_THROW.
◆ CPerfLogGuard() [2/3]Constructor.
Definition at line 500 of file perf_log.hpp.
References CTempString::empty(), and NCBI_THROW.
◆ CPerfLogGuard() [3/3]Constructor.
Definition at line 525 of file perf_log.hpp.
References CTempString::empty(), and NCBI_THROW.
◆ CRequestContext() [1/2] ◆ CRequestContext() [2/2] ◆ CRequestContext_PassThrough() [1/2] CRequestContext_PassThrough::CRequestContext_PassThrough ( CRequestContext ctx ) inline ◆ CRequestContext_PassThrough() [2/2] CRequestContext_PassThrough::CRequestContext_PassThrough ( void ) inline ◆ CRequestContextGuard_Base()Initialize guard.
Definition at line 933 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() [2/2] CSharedHitId::CSharedHitId ( void ) inlineDefinition at line 74 of file request_ctx.hpp.
◆ CStreamDiagHandler()Constructor.
This does *not* own the stream; users will need to clean it up themselves if appropriate.
Definition at line 6527 of file ncbidiag.cpp.
References CStreamDiagHandler_Base::SetLogName().
◆ CStreamDiagHandler_Base() CStreamDiagHandler_Base::CStreamDiagHandler_Base ( void ) ◆ CSysLog() [1/2] ◆ CSysLog() [2/2] ◆ DECLARE_CLASS_STATIC_MUTEX() CSysLog::DECLARE_CLASS_STATIC_MUTEX ( sm_Mutex ) private ◆ DeleteProperty() ◆ Deserialize() ◆ DiagAssert() ◆ DiagAssertIfSuppressedSystemMessageBox() ◆ DiagFatal() ◆ DiagHandler_Reopen() void DiagHandler_Reopen ( void ) ◆ DiagTrouble()Display trouble error message.
Definition at line 8045 of file ncbidiag.cpp.
References CNcbiDiag::CNcbiDiag(), eDiag_Fatal, CNcbiDiag::Endm, and info.
Referenced by CConcurrentMap< Key, Value, Comparator, Allocator, CntChildsInNode, MaxTreeHeight, DeletionDelay, DelStoreCapacity >::x_AddNewRoot().
◆ DiagValidate() ◆ DisableDiagPostLevelChange() bool DisableDiagPostLevelChange ( bool disable_change =true
) ◆ Discard() [1/2] void CPerfLogger::Discard ( void ) inline ◆ Discard() [2/2] void CPerfLogGuard::Discard ( void ) inline ◆ DiscardMessages() void CDiagContext::DiscardMessages ( void ) ◆ Empty() bool CSharedHitId::Empty ( void ) const inline ◆ EndSpan() [1/3] void CJaegerTracerSpan::EndSpan ( void ) inlineoverridevirtual ◆ EndSpan() [2/3] void COpentelemetryTracerSpan::EndSpan ( void ) overridevirtual ◆ EndSpan() [3/3] ◆ Enumerate()
template<class TCallback >
void CRequestContext_PassThrough::Enumerate ( TCallback callback ) inline ◆ ErrCode() ErrCode::ErrCode ( int code, int subcode =0
) inline ◆ Extra()
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(), COpentelemetryTracer::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 2434 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::GetRequestContext(), 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_IsDisabledAppLogEvent(), 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() ◆ ForceImportantFlags() ◆ FormatExtraMessage() string SDiagMessage::FormatExtraMessage ( void ) const ◆ 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 ) ◆ Get() ◆ GetAction() EAction CDiagCollectGuard::GetAction ( void ) const inline ◆ GetAllowedSessionIDFormat() ◆ GetAppName() [1/2] ◆ GetAppName() [2/2] ◆ GetAppState() [1/3] ◆ GetAppState() [2/3]Return application state for the current thread if it's set.
If not set, return global application state. This is a shortcut to the current request context's GetAppState().
Definition at line 2904 of file ncbidiag.cpp.
References CRequestContext::GetAppState(), and CDiagContext::GetRequestContext().
Referenced by CGRPCRequestLogger::CGRPCRequestLogger(), SDiagMessage::GetAppState(), CDiagContext::GetProperty(), CDiagContext::PrintRequestStart(), CDiagContext::PrintRequestStop(), CSharedHitId::SetHitId(), CDiagContext::x_DiagAtApplicationLevel(), CGRPCRequestLogger::x_Init(), and SDiagMessage::x_SaveContextData().
◆ GetAppState() [3/3] ◆ GetAutoIncRequestIDOnPost() bool CRequestContext::GetAutoIncRequestIDOnPost ( void ) const inline ◆ GetBadSessionIDAction() ◆ 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 ◆ GetClient() string SDiagMessage::GetClient ( void ) const ◆ GetClientIP() string CRequestContext::GetClientIP ( void ) const inlineClient IP/hostname.
Definition at line 754 of file request_ctx.hpp.
References CRequestContext::eProp_ClientIP, CDiagContext::GetDefaultClientIP(), GetDiagContext(), CRequestContext::m_ClientIP, and CRequestContext::x_IsSetProp().
Referenced by CGRPCServerCallbacks::BeginRequest(), g_AppendClientIPAndSessionID(), SDiagMessage::GetClient(), CDiagContext::GetProperty(), SNetStorageRPC::MkStdRequest(), CNCActiveHandler::ProxyGetMeta(), CNCActiveHandler::ProxyGetSize(), CNCActiveHandler::ProxyHasBlob(), CNCActiveHandler::ProxyProlong(), CNCActiveHandler::ProxyRead(), CNCActiveHandler::ProxyReadLast(), CNCActiveHandler::ProxyRemove(), CNCActiveHandler::ProxySetValid(), CNCActiveHandler::ProxyWrite(), s_UpdateVDBRequestContext(), CNCActiveHandler::SearchMeta(), SDiagMessage::x_SaveContextData(), CNCActiveHandler::x_SendCopyPutCmd(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
◆ GetCollectSeverity() EDiagSev CDiagCollectGuard::GetCollectSeverity ( void ) const inline ◆ GetCurrentSubHitID() ◆ GetCurrentSubHitId() TSubHitId CSharedHitId::GetCurrentSubHitId ( void ) const inline ◆ GetDefaultAutoIncRequestIDOnPost() bool CRequestContext::GetDefaultAutoIncRequestIDOnPost ( void ) static ◆ GetDefaultClientIP() string CDiagContext::GetDefaultClientIP ( void ) static ◆ GetDefaultHitID() string CDiagContext::GetDefaultHitID ( void ) constGet 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 1850 of file ncbidiag.cpp.
◆ GetDefaultSessionID() string CDiagContext::GetDefaultSessionID ( void ) const ◆ GetDescription() ◆ GetDiagContext()Get diag context instance.
Definition at line 820 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(), CPSGDataLoader_Impl::CPSGDataLoader_Impl(), 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(), SPSG_NcbiPeerID::Init(), SNetScheduleAPIImpl::Init(), CTLibContext::InitApplicationName(), CRequestContext::IsSetClientIP(), CRequestContext::IsSetHitID(), CRequestContext::IsSetSessionID(), CNcbiLogFields::LogFields(), CCgiApplication::LogRequest(), main(), Main(), NcbiSys_main(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), COpentelemetryTracer::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_SpawnUnix(), CSparseGraph::Save(), SetDiagHandler(), SetDiagRequestId(), SetDiagUserAndHost(), CSharedHitId::SetHitId(), CRequestContext::SetHitID(), ColumnarVcfCache::SetInfoFields(), CCgiResponse::SetMultipartMode(), CNcbiApplicationAPI::SetProgramDisplayName(), CRequestContext::SetSessionID(), CGridCommandLineInterfaceApp::SetUp_NetStorageCmd(), CDiagContext::SetupDiag(), CExec::Spawn(), CExec::SpawnL(), CExec::SpawnLE(), CExec::SpawnLP(), CExec::SpawnLPE(), CExec::SpawnV(), CExec::SpawnVE(), CExec::SpawnVP(), CExec::SpawnVPE(), CLogLatencyReport::Start(), CCgi2RCgiApp::SubmitJob(), 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(), SPSG_UserArgsBuilder::x_MergeOthers(), 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() ◆ GetDiagErrCodeInfo() ◆ GetDiagFilter() ◆ GetDiagHandler()Get the currently set diagnostic handler class.
Definition at line 6434 of file ncbidiag.cpp.
References _ASSERT, and CDiagLock::eRead.
Referenced by CNcbiApplicationAPI::AppMain(), CWindowsCmdErrorHandler::CWindowsCmdErrorHandler(), CwxLogDiagHandler::CwxLogDiagHandler(), DiagHandler_Reopen(), CNcbiApplicationAPI::FlushDiag(), GetDiagStream(), GetLogFile(), init_common(), CAsyncDiagHandler::InstallToDiag(), CDiagContextThreadData::RemoveCollectGuard(), CAsyncDiagHandler::RemoveFromDiag(), SetDiagNode(), SetLogFile(), python::SetLogger(), CDiagContext::SetupDiag(), and CNcbiApplicationAPI::x_HonorStandardSettings().
◆ GetDiagPostLevel() ◆ GetDiagRequestId() Uint8 GetDiagRequestId ( void ) ◆ GetDiagStream() ◆ GetDiagTrace() bool GetDiagTrace ( void ) ◆ GetDisabledAppLog() [1/2] bool CDiagContext::GetDisabledAppLog ( void ) staticGet flag disabling applog events (set by DIAG_DISABLE_APPLOG_MESSAGES variable).
Definition at line 447 of file ncbidiag.cpp.
References s_DisableAppLog.
◆ GetDisabledAppLog() [2/2] bool CRequestContext::GetDisabledAppLog ( void ) const inline ◆ GetDisabledAppLogEvents() [1/2] ◆ GetDisabledAppLogEvents() [2/2] ◆ GetDtab() ◆ GetElapsedTime() double CPerfLogger::GetElapsedTime ( void ) const inline ◆ GetEncodedAppName() const string & CDiagContext::GetEncodedAppName ( void ) const ◆ GetEncodedHost() const string & CDiagContext::GetEncodedHost ( void ) const ◆ GetEncodedHostname() const string & CDiagContext::GetEncodedHostname ( void ) const ◆ GetEncodedSessionID() [1/2] string CDiagContext::GetEncodedSessionID ( void ) const ◆ GetEncodedSessionID() [2/2] string CRequestContext::GetEncodedSessionID ( void ) const inline ◆ GetErrCodeString() const char * CRequestContextException::GetErrCodeString ( void ) const overridevirtual ◆ GetErrorCode() int CNcbiDiag::GetErrorCode ( void ) constGet error code of the current message.
◆ GetErrorSubCode() int CNcbiDiag::GetErrorSubCode ( void ) constGet error subcode of the current message.
◆ GetEventName() ◆ GetExitCode() int CDiagContext::GetExitCode ( void ) const inline ◆ GetExitSignal() int CDiagContext::GetExitSignal ( void ) const inline ◆ GetFastCGIIteration() Uint8 GetFastCGIIteration ( void ) inline ◆ GetFile() [1/2] const char* CDiagCompileInfo::GetFile ( void ) const ◆ GetFile() [2/2] const char* CNcbiDiag::GetFile ( void ) const ◆ GetFunction() [1/2] const string& CDiagCompileInfo::GetFunction ( void ) const ◆ GetFunction() [2/2] const char* CNcbiDiag::GetFunction ( void ) const ◆ GetGlobalAppState() ◆ GetGlobalRequestId() string CDiagContext::GetGlobalRequestId ( void ) const inline ◆ GetHitId() ◆ GetHitID() string CRequestContext::GetHitID ( void ) const inline ◆ GetHost() [1/2] ◆ GetHost() [2/2] ◆ GetHostIP() ◆ GetHostLocation() ◆ GetHostname() const string & CDiagContext::GetHostname ( void ) const ◆ GetHostRole() ◆ GetLine() [1/2] int CDiagCompileInfo::GetLine ( void ) const ◆ GetLine() [2/2] size_t CNcbiDiag::GetLine ( void ) const ◆ GetLogFile() [1/3] ◆ GetLogFile() [2/3]Get current log file name.
If file_type is eDiagFile_All, always returns empty string.
Definition at line 7080 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] ◆ GetLogger() ◆ GetLoggerStartTime() const CTime& CPerfLogger::GetLoggerStartTime ( void ) const inline ◆ GetLogName() [1/4] string CDiagHandler::GetLogName ( void ) virtual ◆ GetLogName() [2/4] string CStreamDiagHandler_Base::GetLogName ( void ) virtual ◆ GetLogName() [3/4] string CAsyncDiagHandler::GetLogName ( void ) virtual ◆ GetLogName() [4/4] string CSysLog::GetLogName ( void ) inlinevirtual ◆ GetLogRate_Limit() ◆ GetLogRate_Period() ◆ GetLogStream() ◆ GetLogTruncate() bool CDiagContext::GetLogTruncate ( void ) static ◆ GetModule() [1/2] const char* CDiagCompileInfo::GetModule ( void ) const ◆ GetModule() [2/2] const char* CNcbiDiag::GetModule ( void ) const ◆ GetNextHitID() string CDiagContext::GetNextHitID ( void ) const ◆ GetNextRequestID() ◆ GetNextSubHitID() ◆ GetNextSubHitId() TSubHitId CSharedHitId::GetNextSubHitId ( void ) inline ◆ GetOmitStackTrace() bool CNcbiDiag::GetOmitStackTrace ( void ) const inline ◆ GetPID()Get cached PID (read real PID if not cached yet).
Definition at line 1628 of file ncbidiag.cpp.
References CCurrentProcess::GetPid(), and CDiagContext::sm_PID.
Referenced by CGridCommandLineInterfaceApp::Cmd_Login(), SNetScheduleAPIImpl::Init(), CPubseqGatewayApp::OnInfo(), CJaegerTracer::OnRequestStart(), COpentelemetryTracer::OnRequestStart(), CFileHandleDiagHandler::Reopen(), SGridWorkerNodeImpl::Run(), s_CreateUID(), SDiagMessage::SDiagMessage(), CDiagContext::x_CreateUID_AsyncSafe(), CNetScheduleHandler::x_ProcessHealth(), CNetStorageHandler::x_ProcessInfo(), CNetScheduleHandler::x_ProcessVersion(), CNetScheduleDApp::x_WritePid(), and CNetStorageDApp::x_WritePid().
◆ GetPostFlags()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 ◆ GetProcessPostNumber() ◆ GetProperties() [1/2] ◆ GetProperties() [2/2] ◆ GetProperty() [1/2] ◆ GetProperty() [2/2]Get application context property by name, return empty string if the property is not set.
If mode is eProp_Default and the property is not a known one, check thread-local properties first.
Definition at line 2120 of file ncbidiag.cpp.
References CStopWatch::AsString(), map_checker< Container >::end(), CDiagLock::eRead, map_checker< Container >::find(), CDiagContext::GetAppName(), CDiagContext::GetAppState(), CRequestContext::GetClientIP(), CDiagContext::GetHostIP(), CDiagContext::GetHostname(), CDiagContext::GetRequestContext(), CRequestContext::GetRequestTimer(), CDiagContext::GetSessionID(), CDiagContext::GetUsername(), NStr::Int8ToString(), NStr::IntToString(), CRequestContext::IsSetRequestStatus(), kEmptyStr, 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_ExitCode, CDiagContext::m_ExitSig, CDiagContext::m_Properties, and s_AppStateToStr().
◆ GetReadOnly() bool CRequestContext::GetReadOnly ( void ) const inline ◆ GetRef() ◆ GetRequestContext() [1/2] CRequestContext& CRequestContextGuard_Base::GetRequestContext ( void ) const inline ◆ GetRequestContext() [2/2]Shortcut to CDiagContextThreadData::GetThreadData().GetRequestContext()
Definition at line 2003 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(), CDiagContext_Extra::Flush(), 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(), COpentelemetryTracer::OnRequestStart(), CHTMLPageStat::PrintBegin(), CDiagContext::PrintStop(), CCgiApplication::ProcessHttpReferer(), SPSG_IoSession::ProcessRequest(), CCgiContext::RetrieveTrackingId(), SGridWorkerNodeImpl::Run(), CThread::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CPhidIdGenerator::s_GenerateSpanId(), CPhidIdGenerator::s_GetBaseHitId(), s_GetNextLogPrefix(), CPhidIdGenerator::s_GetParentHitId(), 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(), CDiagContext::x_StartRequest(), and CNcbiApplicationAPI::x_TryMain().
◆ GetRequestID()Get request ID (or zero if not set).
Definition at line 715 of file request_ctx.hpp.
References CRequestContext::eProp_RequestID, CRequestContext::m_RequestID, and CRequestContext::x_IsSetProp().
Referenced by GetDiagRequestId(), CDiagContextThreadData::GetRequestId(), SErrorEmulatorParameter::IsActive(), s_CreateDiagRequest(), s_GetNextLogPrefix(), SDiagMessage::SDiagMessage(), CRequestContext::SetSessionID(), CNetStorageHandler::x_GetConnRef(), CNetScheduleHandler::x_GetConnRef(), CDiagContext::x_GetNextHitID(), and CNetScheduleHandler::x_ProcessMsgBatchSubmit().
◆ GetRequestStatus() int CRequestContext::GetRequestStatus ( void ) const inline ◆ GetRequestTimer() [1/2] CStopWatch& CRequestContext::GetRequestTimer ( void ) inline ◆ GetRequestTimer() [2/2] ◆ GetSession() string SDiagMessage::GetSession ( void ) const ◆ GetSessionID() [1/2] string CDiagContext::GetSessionID ( void ) const ◆ GetSessionID() [2/2] string CRequestContext::GetSessionID ( void ) const inlineSession ID.
Definition at line 784 of file request_ctx.hpp.
References CRequestContext::eProp_SessionID, CDiagContext::GetDefaultSessionID(), GetDiagContext(), CEncodedString::GetOriginalString(), CRequestContext::m_SessionID, CRequestContext::SetSessionID(), and CRequestContext::x_IsSetProp().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), g_AppendClientIPAndSessionID(), CDiagContext::GetSessionID(), SNetStorageRPC::MkStdRequest(), CNCActiveHandler::ProxyGetMeta(), CNCActiveHandler::ProxyGetSize(), CNCActiveHandler::ProxyHasBlob(), CNCActiveHandler::ProxyProlong(), CNCActiveHandler::ProxyRead(), CNCActiveHandler::ProxyReadLast(), CNCActiveHandler::ProxyRemove(), CNCActiveHandler::ProxySetValid(), CNCActiveHandler::ProxyWrite(), CCgiContext::RetrieveTrackingId(), s_GetRequestID(), s_UpdateVDBRequestContext(), CNCActiveHandler::SearchMeta(), CNCActiveHandler::x_SendCopyPutCmd(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
◆ GetSeverity() EDiagSev CNcbiDiag::GetSeverity ( void ) const ◆ GetSeverityCap() EDiagSev CDiagCollectGuard::GetSeverityCap ( void ) const inline ◆ GetSpan() [1/2] jaegertracing::Span& CJaegerTracerSpan::GetSpan ( void ) inline ◆ GetSpan() [2/2] TSpan& COpentelemetryTracerSpan::GetSpan ( void ) inline ◆ GetSplitLogFile() bool GetSplitLogFile ( void ) ◆ GetSrcTraceParent() const string& CRequestContext::GetSrcTraceParent ( void ) const inline ◆ GetSrcTraceState() const string& CRequestContext::GetSrcTraceState ( void ) const inlineThe getters provide access to the incoming values (unlike GetTraceState and GetTraceParent which return the new values to be used for outgoing connections).
The getters are expected to be used mostly by tracer and span classes.
Definition at line 457 of file request_ctx.hpp.
References CRequestContext::m_TraceState.
◆ GetStartingPoint() Uint8 CDiagCollectGuard::GetStartingPoint ( void ) const inline ◆ GetStdStatusMessage() string CRequestStatus::GetStdStatusMessage ( ECode code ) staticDefinition 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::e429_Too_Many_Requests, 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 ◆ GetStream() [2/2] virtual CNcbiOstream* CStreamDiagHandler::GetStream ( void ) inlinevirtual ◆ GetStringUID() [1/3] void CDiagContext::GetStringUID ( TUID uid, char * buf ) const ◆ GetStringUID() [2/3] void CDiagContext::GetStringUID ( TUID uid, char * buf, size_t buf_len ) constFill buffer with string representation of UID.
The buffer size must be at least 17 bytes.
Definition at line 1778 of file ncbidiag.cpp.
References _ASSERT, buf, and int.
◆ GetStringUID() [3/3] string CDiagContext::GetStringUID ( TUID uid =0
) const
Return string representation of UID.
If the argument UID is 0, use the one from the diag context.
Definition at line 1793 of file ncbidiag.cpp.
References buf, CDiagContext::GetUID(), and string.
Referenced by CPSGDataLoader_Impl::CPSGDataLoader_Impl(), CDiagContext::GetStringUID(), SPSG_NcbiPeerID::Init(), SNetScheduleAPIImpl::Init(), CJaegerTracer::OnRequestStart(), COpentelemetryTracer::OnRequestStart(), CCgiResponse::SetMultipartMode(), CDiagContext::WriteStdPrefix(), CNetStorageHandler::x_GetConnRef(), CNetScheduleHandler::x_GetConnRef(), and SPSG_UserArgsBuilder::x_MergeOthers().
◆ GetThreadPostNumber() ◆ GetTID() ◆ GetTime() CTime SDiagMessage::GetTime ( void ) const ◆ GetTraceParent() [1/4] const string CRequestContext::GetTraceParent ( void ) const inline ◆ GetTraceParent() [2/4] ◆ GetTraceParent() [3/4] const string& CJaegerTracerSpan::GetTraceParent ( void ) const inlineoverridevirtual ◆ GetTraceParent() [4/4] const string & COpentelemetryTracerSpan::GetTraceParent ( void ) const overridevirtual ◆ GetTracerSpan() shared_ptr<ITracerSpan> CRequestContext::GetTracerSpan ( void ) const inline ◆ GetTracerSpanKind() ◆ GetTraceState() [1/4] const string CRequestContext::GetTraceState ( void ) const inline ◆ GetTraceState() [2/4] ◆ GetTraceState() [3/4] const string& CJaegerTracerSpan::GetTraceState ( void ) const inlineoverridevirtual ◆ GetTraceState() [4/4] const string & COpentelemetryTracerSpan::GetTraceState ( void ) const overridevirtual ◆ GetUID() [1/2] ◆ GetUID() [2/2] ◆ GetUsername() const string & CDiagContext::GetUsername ( void ) const ◆ GetVersion() TVersion CRequestContext::GetVersion ( void ) const inline ◆ HaveDescription()Check if error description exists.
Return TRUE if description for specified error code exists, otherwise return FALSE.
◆ HonorRegistrySettings()Definition at line 252 of file syslog.cpp.
References CSysLog::eAuth, CSysLog::eAuthPriv, CSysLog::eDaemon, CSysLog::eDefaultFacility, CSysLog::eFTP, CSysLog::eLocal0, CSysLog::eMail, NStr::eNocase, NStr::EqualNocase(), CSysLog::eUser, CSysLog::fNoOverride, IRegistry::Get(), CNcbiApplicationAPI::GetConfig(), CNcbiApplication::Instance(), CSysLog::m_DefaultFacility, CSysLog::m_Flags, NULL, CSysLog::sm_Current, and NStr::StartsWith().
Referenced by CNcbiApplicationAPI::x_HonorStandardSettings().
◆ IgnoreDiagDieLevel()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 6322 of file ncbidiag.cpp.
References CDiagLock::eWrite.
◆ InitMessages() void CDiagContext::InitMessages ( size_t max_size =100
) ◆ InstallToDiag() void CAsyncDiagHandler::InstallToDiag ( void ) ◆ IsApplogSeverityLocked() static bool CDiagContext::IsApplogSeverityLocked ( void ) inlinestatic ◆ IsCollectingMessages() bool CDiagContext::IsCollectingMessages ( void ) const inline ◆ IsDiagStream() ◆ IsMainThreadDataInitialized() bool CDiagContext::IsMainThreadDataInitialized ( void ) static ◆ 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 ◆ IsRunning() bool CRequestContext::IsRunning ( void ) const inlineprivate ◆ IsSet() ◆ IsSetBytesRd() bool CRequestContext::IsSetBytesRd ( void ) const inline ◆ IsSetBytesWr() bool CRequestContext::IsSetBytesWr ( void ) const inline ◆ IsSetClientIP() bool CRequestContext::IsSetClientIP ( void ) const inline ◆ IsSetDiagErrCodeInfo() bool IsSetDiagErrCodeInfo ( ) ◆ IsSetDiagHandler() bool IsSetDiagHandler ( void ) ◆ IsSetDiagPostFlag() ◆ IsSetDtab() bool CRequestContext::IsSetDtab ( void ) const inline ◆ IsSetExitCode() bool CDiagContext::IsSetExitCode ( void ) const inline ◆ IsSetExplicitClientIP() bool CRequestContext::IsSetExplicitClientIP ( void ) const inline ◆ IsSetExplicitHitID() bool CRequestContext::IsSetExplicitHitID ( void ) const inline ◆ IsSetExplicitSessionID() bool CRequestContext::IsSetExplicitSessionID ( void ) const inline ◆ IsSetHitID()Check if there's an explicit hit id or the default one.
Definition at line 826 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(), CCgiRequest::x_InitRequestContext(), CId2ReaderBase::x_SetContextData(), CRequestContext::x_UpdateStdPassThroughProp(), and CRequestContext::x_UpdateSubHitID().
◆ IsSetOldPostFormat() bool CDiagContext::IsSetOldPostFormat ( void ) static ◆ IsSetProperty() ◆ IsSetRequestID() bool CRequestContext::IsSetRequestID ( void ) const inline ◆ IsSetRequestStatus() bool CRequestContext::IsSetRequestStatus ( void ) const inline ◆ IsSetSessionID() bool CRequestContext::IsSetSessionID ( void ) const inline ◆ IsShared() bool CSharedHitId::IsShared ( void ) const inline ◆ IsUsingRootLog() bool CDiagContext::IsUsingRootLog ( void ) static ◆ IsUsingSystemThreadId() bool CDiagContext::IsUsingSystemThreadId ( void ) static ◆ IsValidSessionID()Check if session id fits the allowed format.
Definition at line 500 of file request_ctx.cpp.
References NStr::EndsWith(), CRequestContext::eSID_Ncbi, CRequestContext::eSID_Other, CRequestContext::eSID_Standard, NStr::fConvErr_NoThrow, CRequestContext::GetAllowedSessionIDFormat(), isalnum(), ITERATE, kAllowedIdMarkchars, NPOS, NStr::StringToUInt(), and NStr::StringToUInt8().
Referenced by CRequestContext::SetSessionID().
◆ IsVisibleDiagPostLevel() ◆ LogFields()template<class TEntries >
void CNcbiLogFields::LogFields ( const TEntries & entries ) const inline ◆ MDiagClass() MDiagClass::MDiagClass ( const char * nclass ) ◆ MDiagFunction() MDiagFunction::MDiagFunction ( const char * function ) ◆ MDiagModule() MDiagModule::MDiagModule ( const char * module ) ◆ NCBI_EXCEPTION_DEFAULT() ◆ NcbiLog_AppGetHitID() char* NcbiLog_AppGetHitID ( void )Get hit ID (HID, a.k.a.
PHID) for the whole application.
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.
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 ) ◆ NcbiLog_AppNewSession() void NcbiLog_AppNewSession ( void ) ◆ 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.
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'.
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.
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'.
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).
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 ) ◆ NcbiLog_AppStopSignal() void NcbiLog_AppStopSignal ( int exit_status, int exit_signal ) ◆ NcbiLog_Context_Attach() ◆ NcbiLog_Context_Create()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.
Definition at line 2644 of file ncbi_c_log.c.
References ctx, NcbiLog_InitForAttachedContext(), NULL, and s_CreateContext().
◆ NcbiLog_Context_Destroy() ◆ NcbiLog_Context_Detach() void NcbiLog_Context_Detach ( void ) ◆ NcbiLog_Critical() void NcbiLog_Critical ( const char * msg ) ◆ NcbiLog_Default_MTLock_Handler()Default implementation of simple MT locking callback.
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().
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 ) ◆ NcbiLog_Error() void NcbiLog_Error ( const char * msg ) ◆ NcbiLog_Extra()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 ) ◆ 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.
Definition at line 3264 of file ncbi_c_log.c.
References free().
◆ NcbiLog_GetCurrentSubHitID() char* NcbiLog_GetCurrentSubHitID ( void ) ◆ NcbiLog_GetCurrentSubHitID_Prefix() char* NcbiLog_GetCurrentSubHitID_Prefix ( const char * prefix )Get the last generated sub-hit ID.
Definition at line 3218 of file ncbi_c_log.c.
References ctx, eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, 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.
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 ) ◆ 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 ) ◆ NcbiLog_GetNextSubHitID() char* NcbiLog_GetNextSubHitID ( void ) ◆ 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.
Definition at line 3244 of file ncbi_c_log.c.
References ctx, eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), s_GetSubHitID(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.
Referenced by NcbiLog_GetNextSubHitID().
◆ NcbiLog_GetRequestId() ◆ NcbiLog_GetSession() char* NcbiLog_GetSession ( void )Get sessio ID (SID) for the request.
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() ◆ NcbiLog_Info() void NcbiLog_Info ( const char * msg ) ◆ NcbiLog_Init()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.
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.
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 ) ◆ NcbiLog_InitMT() void NcbiLog_InitMT ( const char * appname ) ◆ NcbiLog_InitST() void NcbiLog_InitST ( const char * appname ) ◆ NcbiLog_MTLock_Create() ◆ NcbiLog_MTLock_Delete() ◆ NcbiLog_NewHitID() void NcbiLog_NewHitID ( void ) ◆ NcbiLog_NewSession() void NcbiLog_NewSession ( void ) ◆ NcbiLog_Note() ◆ NcbiLog_Perf()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.
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()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.
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.
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.
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()Set up diagnostics destination.
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()Variant of NcbiLog_SetDestination for logging to a specific file (eNcbiLog_File).
This is CLog/ncbi_applog specific, not a standard feature.
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().
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.
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() ◆ NcbiLog_SetProcessId() ◆ NcbiLog_SetRequestId() ◆ 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.
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.
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() ◆ 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.
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 ) ◆ NcbiLog_UpdateOnFork()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.
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 ) ◆ New() ◆ OnRequestStart() [1/3]Implements IRequestTracer.
Definition at line 135 of file jaeger_tracer.cpp.
References buf, context, CDiagContext::Extra(), GetCurrentThreadSystemID(), GetDiagContext(), CDiagContext::GetHost(), CDiagContext::GetPID(), CDiagContext::GetStringUID(), CDiagContext::GetUID(), hex(), id_hash(), and CDiagContext_Extra::Print().
◆ OnRequestStart() [2/3]Implements IRequestTracer.
Definition at line 415 of file opentelemetry_tracer.cpp.
References buf, context, ITracerSpan::eKind_Client, ITracerSpan::eKind_Internal, ITracerSpan::eKind_Server, ERR_POST, CDiagContext::Extra(), flags, GetCurrentThreadSystemID(), GetDiagContext(), CDiagContext::GetHost(), CDiagContext::GetPID(), CDiagContext::GetRequestContext(), CDiagContext::GetStringUID(), CDiagContext::GetUID(), CDiagContext_Extra::Print(), s_DefaultSpanNamePrefix, s_GetTracer(), s_ParseIds(), s_UpdateTraceState(), string, and Warning().
◆ OnRequestStart() [3/3] ◆ OnRequestStop() [1/3] ◆ OnRequestStop() [2/3] ◆ OnRequestStop() [3/3] ◆ operator delete() void CDiagRestorer::operator delete ( void * ) inlineprivatePrivate 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 2974 of file ncbidiag.hpp.
◆ operator delete[]() void CDiagRestorer::operator delete[] ( void * ) inlineprivatePrivate 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 2980 of file ncbidiag.hpp.
◆ operator new() void* CDiagRestorer::operator new ( size_t ) inlineprivatePrivate new operator.
Prohibit dynamic 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 new[]() void* CDiagRestorer::operator new[] ( size_t ) inlineprivatePrivate new[] operator.
Prohibit dynamic 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()() virtual void INextDiagMessage::operator() ( SDiagMessage & msg ) pure virtual ◆ operator<<() [1/6] ◆ operator<<() [2/6] ◆ operator<<() [3/6] ◆ operator<<() [4/6] ◆ operator<<() [5/6] ◆ operator<<() [6/6] ◆ operator=() [1/5] ◆ operator=() [2/5] ◆ operator=() [3/5]Private assignment operator to prohibit assignment.
◆ operator=() [4/5] ◆ operator=() [5/5]Assignment of messages.
Definition at line 4718 of file ncbidiag.cpp.
References SDiagMessage::m_AllowBadExtraNames, 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_ExtraArgs, 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, SDiagMessageData::m_Prefix, SDiagMessage::m_ProcPost, SDiagMessage::m_RequestId, SDiagMessageData::m_Session, SDiagMessage::m_Severity, SDiagMessage::m_ThrPost, SDiagMessage::m_TID, SDiagMessage::m_TypedExtra, string, and SDiagMessage::x_SaveContextData().
◆ ParseCurrFunctName() void CDiagCompileInfo::ParseCurrFunctName ( void ) const private ◆ ParseDiagStream() ◆ ParseMessage()Parse the whole string into the message.
Return true on success, false if parsing failed.
Definition at line 4984 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, lbr(), 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 ) ◆ Post() [1/12] ◆ Post() [2/12]Post message to the handler.
Implements CDiagHandler.
Definition at line 6716 of file ncbidiag.cpp.
References CObject::AddReference(), CFileHandleDiagHandler::ComposeMessage(), CStopWatch::Elapsed(), CDiagLock::ePost, CDiagHandler::fDefault, CDiagFileHandleHolder::GetHandle(), CStopWatch::IsRunning(), kLogReopenDelay, CFileHandleDiagHandler::m_Handle, CFileHandleDiagHandler::m_HandleLock, CFileHandleDiagHandler::m_HavePosts, CFileHandleDiagHandler::m_Messages, CFileHandleDiagHandler::m_ReopenTimer, NcbiSys_write, CObject::RemoveReference(), CFileHandleDiagHandler::Reopen(), s_ReopenEntered, and str().
◆ Post() [3/12]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 7205 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]Implementation of CDiagHandler.
Implements CDiagHandler.
Definition at line 7372 of file ncbidiag.cpp.
References CDiagHandler::ComposeMessage(), CSafeStatic< T, Callbacks >::Get(), GetDiagDieLevel(), CGuard< Resource, Lock, Unlock, ReportExceptions >::Guard(), CAsyncDiagHandler::m_AsyncThread, SAsyncDiagMessage::m_Composed, SAsyncDiagMessage::m_FileType, SAsyncDiagMessage::m_Message, SDiagMessage::m_Severity, NCBI_PARAM_TYPE(), CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), string, and thr.
◆ Post() [5/12]Post message to handler.
Implements CDiagHandler.
Definition at line 100 of file syslog.cpp.
References CSysLog::eAlert, CSysLog::eCritical, CSysLog::eDebug, eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, eDiag_Warning, CSysLog::eError, CSysLog::eInfo, CSysLog::eNotice, CSysLog::eWarning, SDiagMessage::fNoEndl, SDiagMessage::m_Severity, and SDiagMessage::Write().
Referenced by CSysLog::Post().
◆ Post() [6/12]Post message to handler.
Implemented in CLogLatencyReport::SHandler, CNcbiToolkitImpl_DiagHandler, CWindowsCmdErrorHandler, CwxLogDiagHandler, CPythonDiagHandler, CTable2AsnLogger, CCompatDiagHandler, CTeeDiagHandler, CCommentDiagHandler, CSysLog, CAsyncDiagHandler, CFileDiagHandler, CFileHandleDiagHandler, CStreamDiagHandler, and CBlastAppDiagHandler.
Referenced by CAsyncDiagThread::Main(), CBlastAppDiagHandler::Post(), CTeeDiagHandler::Post(), and CwxLogDiagHandler::Post().
◆ Post() [7/12] ◆ Post() [8/12] ◆ Post() [9/12]Log the timing; stop and deactivate the timer.
Definition at line 436 of file perf_log.hpp.
Referenced by g_DoErasePerfLogging(), g_DoPerfLogging(), CPerfLogGuard::Post(), and s_DoDonePerfLogging().
◆ Post() [10/12] ◆ Post() [11/12]Definition at line 69 of file perf_log.cpp.
References CTime::AsString(), CPerfLogger::Discard(), CStopWatch::Elapsed(), CTempString::empty(), CDiagContext::Extra(), g_PostPerf(), GetDiagContext(), GetFastLocalTime(), CTime::IsEmpty(), CPerfLogger::IsON(), CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_FirstStartTime, CPerfLogger::m_LastStartTime, CPerfLogger::m_StopWatch, NCBI_THROW, CPerfLogger::Suspend(), and CPerfLogger::x_CheckValidity().
◆ Post() [12/12] ◆ PostEvent() [1/3] ◆ PostEvent() [2/3]Implements ITracerSpan.
Definition at line 616 of file opentelemetry_tracer.cpp.
References eDPF_AppLog, SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessage::m_ErrCode, SDiagMessage::m_ErrSubCode, SDiagMessage::m_ErrText, SDiagMessage::m_File, SDiagMessage::m_Flags, SDiagMessage::m_Function, SDiagMessage::m_Line, SDiagMessage::m_Module, SDiagMessage::m_Prefix, SDiagMessage::m_ProcPost, SDiagMessage::m_Severity, SDiagMessage::m_ThrPost, SDiagMessage::m_TID, msg(), NStr::NumericToString(), CNcbiDiag::SeverityName(), and string.
◆ PostEvent() [3/3] ◆ PostToConsole() ◆ Print() [1/15] ◆ Print() [2/15] ◆ Print() [3/15] ◆ Print() [4/15]template<class TKey , class TStorage >
Definition at line 1857 of file ncbidiag.hpp.
◆ Print() [5/15]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 2724 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(), COpentelemetryTracer::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] ◆ Print() [7/15] ◆ Print() [8/15] ◆ Print() [9/15] ◆ Print() [10/15] ◆ Print() [11/15] ◆ Print() [12/15] ◆ Print() [13/15] ◆ Print() [14/15] ◆ Print() [15/15] ◆ PrintExtra() void CDiagContext::PrintExtra ( const string & message ) ◆ PrintNcbiAppInfoOnRequest()Definition at line 2389 of file ncbidiag.cpp.
References SBuildInfo::eDevelopmentVersion, SBuildInfo::eGitBranch, SBuildInfo::eProductionVersion, SBuildInfo::eRevision, SBuildInfo::eStableComponentsVersion, SBuildInfo::eSubversionRevision, SBuildInfo::ExtraNameAppLog(), CVersionAPI::GetBuildInfo(), SBuildInfo::GetExtraValue(), CNcbiApplicationAPI::GetFullVersion(), CVersionInfo::GetMajor(), CVersionInfo::GetMinor(), CVersionInfo::GetPatchLevel(), CVersionAPI::GetVersionInfo(), CNcbiApplication::Instance(), NStr::JoinNumeric(), ncbi::grid::netcache::search::fields::key, NCBI_DEVELOPMENT_VER, NCBI_SUBVERSION_REVISION, NStr::NumericToString(), CDiagContext_Extra::Print(), str(), and rapidjson::value.
Referenced by CDiagContext_Extra::Flush(), and CDiagContext::PrintStart().
◆ PrintNcbiAppInfoOnStart()Definition at line 2339 of file ncbidiag.cpp.
References SBuildInfo::date, SBuildInfo::eBuildID, SBuildInfo::eBuiltAs, SBuildInfo::eTeamCityBuildConf, SBuildInfo::eTeamCityBuildNumber, SBuildInfo::eTeamCityProjectName, SBuildInfo::ExtraNameAppLog(), CVersionAPI::GetBuildInfo(), SBuildInfo::GetExtraValue(), CNcbiApplicationAPI::GetFullVersion(), CVersionInfo::GetMajor(), CVersionInfo::GetMinor(), CVersionAPI::GetPackageName(), CVersionAPI::GetPackageVersion(), CVersionInfo::GetPatchLevel(), CNcbiApplicationAPI::GetProgramExecutablePath(), CSystemInfo::GetUserName(), CNcbiApplication::Instance(), ncbi::grid::netcache::search::fields::key, NCBI_SBUILDINFO_DEFAULT, NCBI_TEAMCITY_BUILD_ID, NCBI_TEAMCITY_BUILD_NUMBER, NCBI_TEAMCITY_BUILDCONF_NAME, NCBI_TEAMCITY_PROJECT_NAME, NStr::NumericToString(), CDiagContext_Extra::Print(), and rapidjson::value.
Referenced by CDiagContext::PrintStart().
◆ PrintNcbiRoleAndLocation() ◆ PrintProperties() void CDiagContext::PrintProperties ( void ) ◆ PrintRequestStart() [1/2] void CDiagContext::PrintRequestStart ( const string & message )Print request start message (for request-driven applications)
Definition at line 2864 of file ncbidiag.cpp.
References eDiagAppState_Request, eDiagAppState_RequestBegin, SDiagMessage::eEvent_RequestStart, CDiagContext::GetAppState(), CDiagContext::SetAppState(), and CDiagContext::x_PrintMessage().
Referenced by CGRPCServerCallbacks::BeginRequest(), CNSClientsRegistry::ClearOnTimeout(), CreateErrorRequestContext(), CNetScheduleServer::Exit(), CStatisticsCounters::PrintServerWide(), CQueue::PrintStatistics(), CNetStorageGCDatabase::RemoveObject(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CPubseqGatewayApp::x_CreateRequestContext(), CGetJobNotificationThread::x_DoJob(), CJobQueueCleanerThread::x_DoJob(), CJobQueueExecutionWatcherThread::x_DoJob(), CCgiApplication::x_OnEvent(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetStorageGCApp::x_RemoveObjects(), SWorkerNodeJobContextImpl::x_RunJob(), and SOfflineJobContextImpl::x_RunJob().
◆ PrintRequestStart() [2/2] ◆ PrintRequestStop() void CDiagContext::PrintRequestStop ( void )Print request stop message (for request-driven applications)
Definition at line 2880 of file ncbidiag.cpp.
References eDiagAppState_AppRun, eDiagAppState_RequestEnd, SDiagMessage::eEvent_RequestStop, CDiagContext::GetAppState(), kEmptyStr, CDiagContext::SetAppState(), CDiagContext::x_LogHitID_WithLock(), and CDiagContext::x_PrintMessage().
Referenced by CNSClientsRegistry::ClearOnTimeout(), DismissErrorRequestContext(), CGRPCServerCallbacks::EndRequest(), CNetScheduleServer::Exit(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CStatisticsCounters::PrintServerWide(), CQueue::PrintStatistics(), CNetStorageGCDatabase::RemoveObject(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CGetJobNotificationThread::x_DoJob(), CJobQueueCleanerThread::x_DoJob(), CJobQueueExecutionWatcherThread::x_DoJob(), CCgiApplication::x_OnEvent(), CNetScheduleHandler::x_PrintCmdRequestStop(), CNetStorageHandler::x_PrintMessageRequestStop(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), CPubseqGatewayApp::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetStorageGCApp::x_RemoveObjects(), and CGRPCRequestLogger::~CGRPCRequestLogger().
◆ 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 2197 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 )Print exit message.
Definition at line 2241 of file ncbidiag.cpp.
References ctx, SDiagMessage::eEvent_Stop, CRequestContext::eHitID_Request, CDiagContext::GetRequestContext(), kEmptyStr, CDiagContext::x_IsSetDefaultHitID(), CDiagContext::x_LogHitID_WithLock(), and CDiagContext::x_PrintMessage().
Referenced by CExec::RunSilent(), s_Daemonize(), s_SpawnUnix(), CExec::Spawn(), CExec::SpawnL(), CExec::SpawnLE(), CExec::SpawnLP(), CExec::SpawnLPE(), CExec::SpawnV(), CExec::SpawnVE(), CExec::SpawnVP(), and CExec::SpawnVPE().
◆ PushDiagPostPrefix() void PushDiagPostPrefix ( const char * prefix ) ◆ PushMessage() ◆ Put() [1/8] ◆ Put() [2/8] ◆ Put() [3/8]Helper method to post error code and subcode to diagnostic stream.
Example: CNcbiDiag() << ErrCode(5,3) << "My message";
◆ Put() [4/8] ◆ Put() [5/8]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] ◆ Put() [7/8] ◆ Put() [8/8] ◆ Read() [1/2] ◆ Read() [2/2]Read error description from specified file.
Read error descriptions from the specified file, store it in memory.
Definition at line 8295 of file ncbidiag.cpp.
References file_name.
◆ Release() [1/3] void CDiagCollectGuard::Release ( EAction action ) ◆ Release() [2/3] void CDiagCollectGuard::Release ( void ) ◆ 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 976 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 ) ◆ Reopen() [1/4]Reopen file to enable log rotation.
Reimplemented from CDiagHandler.
Definition at line 6627 of file ncbidiag.cpp.
References CObject::AddReference(), CFileHandleDiagHandler::ComposeMessage(), eDiagFile_Perf, CStopWatch::Elapsed(), CDiagLock::ePost, f, CDiagHandler::fCheck, flags, CDirEntry::fRF_Overwrite, CDirEntry::GetDir(), CFileUtil::GetFreeDiskSpace(), CDiagFileHandleHolder::GetHandle(), CStreamDiagHandler_Base::GetLogName(), CDiagContext::GetPID(), CStopWatch::IsRunning(), ITERATE, kLogReopenDelay, CFileHandleDiagHandler::m_FileType, CFileHandleDiagHandler::m_Handle, CFileHandleDiagHandler::m_HandleLock, CFileHandleDiagHandler::m_HavePosts, CFileHandleDiagHandler::m_LowDiskSpace, CFileHandleDiagHandler::m_Messages, CFileHandleDiagHandler::m_ReopenTimer, NcbiSys_lseek, NcbiSys_write, NULL, CObject::RemoveReference(), CStopWatch::Restart(), s_LogSizeLimit, s_ReopenEntered, SEEK_CUR, str(), and CDiagContext::UpdatePID().
Referenced by CFileHandleDiagHandler::CFileHandleDiagHandler(), CFileHandleDiagHandler::Post(), and CFileHandleDiagHandler::WriteMessage().
◆ Reopen() [2/4]Reopen file to enable log rotation.
Reimplemented from CDiagHandler.
Definition at line 7144 of file ncbidiag.cpp.
References CStopWatch::Elapsed(), CDiagHandler::fCheck, flags, CStopWatch::IsRunning(), kLogReopenDelay, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_Perf, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::m_Trace, CDiagHandler::Reopen(), CStopWatch::Restart(), and s_ReopenEntered.
Referenced by CFileDiagHandler::Post(), and CFileDiagHandler::WriteMessage().
◆ Reopen() [3/4] ◆ Reopen() [4/4] ◆ Reset() [1/2] void CRequestContext_PassThrough::Reset ( CTempString name ) inline ◆ Reset() [2/2] void CRequestContext::Reset ( void )Reset all properties to the initial state.
Definition at line 274 of file request_ctx.cpp.
References map_checker< Container >::clear(), eDiagAppState_NotSet, CRequestContext::m_AppState, CRequestContext::m_PassThroughProperties, CRequestContext::m_ReqTimer, CStopWatch::Reset(), CRequestContext::UnsetBytesRd(), CRequestContext::UnsetBytesWr(), CRequestContext::UnsetClientIP(), CRequestContext::UnsetHitID(), CRequestContext::UnsetRequestID(), CRequestContext::UnsetRequestStatus(), CRequestContext::UnsetSessionID(), CRequestContext::x_CanModify(), and CRequestContext::x_LoadEnvContextProperties().
Referenced by SWorkerNodeJobContextImpl::ResetJobContext(), CRequestContext::StopRequest(), CCgiApplication::x_OnEvent(), and CPSGS_Dispatcher::x_PrintRequestStop().
◆ ResetIsConsoleFlag() void CNcbiDiag::ResetIsConsoleFlag ( void ) const inline ◆ ResetIsMessageFlag() void CNcbiDiag::ResetIsMessageFlag ( void ) const inline ◆ ResetIsNoteFlag() void CNcbiDiag::ResetIsNoteFlag ( void ) const inline ◆ ResetLogRates() void CDiagContext::ResetLogRates ( void ) privateDefinition at line 1445 of file ncbidiag.cpp.
References CRequestRateControl::eDiscrete, CRequestRateControl::eErrCode, CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, CDiagContext::GetLogRate_Limit(), CDiagContext::GetLogRate_Period(), CDiagContext::m_AppLogRC, CDiagContext::m_AppLogSuspended, CDiagContext::m_ErrLogRC, CDiagContext::m_ErrLogSuspended, CDiagContext::m_TraceLogRC, and CDiagContext::m_TraceLogSuspended.
◆ ResetPostFlags()Clear specific post flags for the current message.
◆ s_EscapeNewlines() void SDiagMessage::s_EscapeNewlines ( string & buf ) static ◆ s_UnescapeNewlines() void SDiagMessage::s_UnescapeNewlines ( string & buf ) static ◆ SDiagErrCodeDescription() [1/2]Destructor.
Definition at line 3011 of file ncbidiag.hpp.
◆ SDiagErrCodeDescription() [2/2] SDiagErrCodeDescription::SDiagErrCodeDescription ( void ) ◆ SDiagMessage() [1/3]Copy constructor required to store the messages and flush them when the diagnostics setup is finished.
Definition at line 4687 of file ncbidiag.cpp.
◆ SDiagMessage() [2/3] ◆ 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
)
Initialize SDiagMessage fields.
Definition at line 4591 of file ncbidiag.cpp.
References buf, eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, ePostNumber_Increment, file, flags, SDiagMessage::GetAppState(), CRequestContext::GetAutoIncRequestIDOnPost(), CDiagContext::GetPID(), CDiagContext::GetProcessPostNumber(), CDiagContextThreadData::GetRequestContext(), CRequestContext::GetRequestID(), CDiagContextThreadData::GetThreadData(), CDiagContextThreadData::GetThreadPostNumber(), CDiagContextThreadData::GetTID(), len, SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessage::m_ErrCode, SDiagMessage::m_ErrSubCode, SDiagMessage::m_ErrText, SDiagMessage::m_File, SDiagMessage::m_Flags, SDiagMessage::m_Function, SDiagMessage::m_Line, SDiagMessage::m_Module, SDiagMessage::m_PID, SDiagMessage::m_Prefix, SDiagMessage::m_ProcPost, SDiagMessage::m_RequestId, SDiagMessage::m_Severity, SDiagMessage::m_ThrPost, SDiagMessage::m_TID, and CRequestContext::SetRequestID().
Referenced by SDiagMessage::ParseDiagStream().
◆ SelectLastHitID() ◆ SelectLastSessionID() ◆ Serialize() string CRequestContext_PassThrough::Serialize ( EFormat format ) const ◆ Set() ◆ SetAbortHandler() ◆ SetAction() void CDiagCollectGuard::SetAction ( EAction action ) inline ◆ SetAllowedSessionIDFormat() ◆ SetAllPostFlags()Set new post flags for the current message.
◆ SetApplogSeverityLocked() static void CDiagContext::SetApplogSeverityLocked ( bool lock ) inlinestatic ◆ SetAppName() void CDiagContext::SetAppName ( const string & app_name ) ◆ SetAppState() [1/3]Set application state.
Application state is set globally and the thread's state is reset (for the current thread only). Request states are set for the current thread (request context) only.
Definition at line 2917 of file ncbidiag.cpp.
References ctx, eDiagAppState_AppBegin, eDiagAppState_AppEnd, eDiagAppState_AppRun, eDiagAppState_NotSet, eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, ERR_POST_X, CDiagContext::GetRequestContext(), CDiagContext::m_AppState, and Warning().
Referenced by CDiagContext::PrintRequestStart(), CDiagContext::PrintRequestStop(), CCgiApplication::Run(), CDiagContext::SetAppState(), CDiagContext::SetProperty(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), and CFastCgiApplicationMT::x_RunFastCGI().
◆ SetAppState() [2/3] ◆ SetAppState() [3/3] ◆ SetAttribute() [1/3]Implements ITracerSpan.
Definition at line 206 of file jaeger_tracer.cpp.
References ITracerSpan::eClientAddress, ITracerSpan::eClientPort, ITracerSpan::eRequestMethod, ITracerSpan::eServerAddress, ITracerSpan::eServerPort, ITracerSpan::eSessionId, ITracerSpan::eStatusCode, ITracerSpan::eStatusString, ITracerSpan::eUrl, CJaegerTracerSpan::m_Span, and rapidjson::value.
◆ SetAttribute() [2/3] ◆ SetAttribute() [3/3] ◆ SetAutoIncRequestIDOnPost() void CRequestContext::SetAutoIncRequestIDOnPost ( bool enable ) inline ◆ SetAutoWrite() void CDiagContext::SetAutoWrite ( bool value ) ◆ SetBadSessionIDAction() ◆ SetBytesRd() void CRequestContext::SetBytesRd ( Int8 bytes ) inlineDefinition at line 945 of file request_ctx.hpp.
References CRequestContext::eProp_BytesRd, CRequestContext::m_BytesRd, CRequestContext::x_CanModify(), and CRequestContext::x_SetProp().
Referenced by CGRPCRequestLogger::CGRPCRequestLogger(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CDiagContext::SetProperty(), CRequestContext::StartRequest(), CNCMessageHandler::x_CleanCmdResources(), CGRPCRequestLogger::x_Init(), CCgiApplication::x_OnEvent(), CNetStorageHandler::x_ProcessRead(), and CFastCgiApplicationMT::x_ProcessThreadedRequest().
◆ SetBytesWr() void CRequestContext::SetBytesWr ( Int8 bytes ) inlineDefinition at line 974 of file request_ctx.hpp.
References CRequestContext::eProp_BytesWr, CRequestContext::m_BytesWr, CRequestContext::x_CanModify(), and CRequestContext::x_SetProp().
Referenced by CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), s_DoCleanLog(), CDiagContext::SetProperty(), CRequestContext::StartRequest(), CNCMessageHandler::x_CleanCmdResources(), CNetStorageHandler::x_OnData(), CCgiApplication::x_OnEvent(), CPSGS_Dispatcher::x_PrintRequestStop(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), and CGRPCRequestLogger::~CGRPCRequestLogger().
◆ SetClass() [1/2] ◆ SetClass() [2/2] ◆ SetClientIP() void CRequestContext::SetClientIP ( const string & client )Definition at line 321 of file request_ctx.cpp.
References client, CRequestContext::eProp_ClientIP, ERR_POST_X, ip, NStr::IsIPAddress(), kBadIP, len, CRequestContext::m_ClientIP, NStr::TruncateSpaces_Unsafe(), CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_SetProp().
Referenced by CGRPCServerCallbacks::BeginRequest(), s_CreateDiagRequest(), CDiagContext::SetProperty(), SetSessionAndIPAndPHID(), CNCMessageHandler::x_AssignCmdParams(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CNetScheduleHandler::x_LogCommandWithJob(), CNetScheduleHandler::x_OnCmdParserError(), CNetScheduleHandler::x_PrintCmdRequestStart(), SWorkerNodeJobContextImpl::x_RunJob(), and CCgiRequest::x_SetClientIpProperty().
◆ SetCollectSeverity() void CDiagCollectGuard::SetCollectSeverity ( EDiagSev sev ) ◆ SetCustomAttribute() [1/3] ◆ SetCustomAttribute() [2/3] ◆ SetCustomAttribute() [3/3] ◆ SetCustomThreadSuffix() void CAsyncDiagHandler::SetCustomThreadSuffix ( const string & suffix ) ◆ SetDefaultAutoIncRequestIDOnPost() void CRequestContext::SetDefaultAutoIncRequestIDOnPost ( bool enable ) static ◆ SetDefaultClientIP() void CDiagContext::SetDefaultClientIP ( const string & client_ip ) staticSet 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 3040 of file ncbidiag.cpp.
References s_DefaultClientIp.
◆ SetDefaultErrorStatus() void CRequestContextGuard_Base::SetDefaultErrorStatus ( int status ) ◆ SetDefaultHitID() void CDiagContext::SetDefaultHitID ( const string & hit_id ) ◆ SetDefaultSessionID() void CDiagContext::SetDefaultSessionID ( const string & session_id ) ◆ SetDefaultSpanKind() void COpentelemetryTracer::SetDefaultSpanKind ( opentelemetry::trace::SpanKind span_kind ) inline ◆ SetDescription()Set error description for specified error code.
If description for this code already exist, then it will be overwritten.
Referenced by CDiagErrCodeInfo::Read().
◆ SetDiagDieLevel()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].
Definition at line 6301 of file ncbidiag.cpp.
References eDiag_Fatal, CDiagLock::eWrite, and NCBI_THROW.
◆ SetDiagErrCodeInfo() ◆ SetDiagFilter()Set diagnostic filter.
Diagnostic filter acts as a second level filtering mechanism (the primary established by global error post level)
Definition at line 7777 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 ) ◆ SetDiagHandler() [1/2]Set the diagnostic handler using the specified diagnostic handler class.
Definition at line 6393 of file ncbidiag.cpp.
References ctx, ePostNumber_NoIncrement, CDiagLock::eWrite, GetDiagContext(), CDiagHandler::GetLogName(), CDiagContext::GetProcessPostNumber(), and CDiagContext::SetApplogSeverityLocked().
Referenced by Cn3DApp::Cn3DApp(), CNcbiToolkitImpl_DiagHandler::CNcbiToolkitImpl_DiagHandler(), CCgiApplication::ConfigureDiagDestination(), CwxLogDiagHandler::CwxLogDiagHandler(), Cn3DNoWin::Exit(), Cn3DNoWin::Init(), CProjBulderApp::Init(), init_common(), CAsyncDiagHandler::InstallToDiag(), Cn3DApp::OnExit(), CAsyncDiagHandler::RemoveFromDiag(), CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastnApp::Run(), CTblastxApp::Run(), CTbl2AsnApp::Run(), s_RestoreOrigDiagHandler(), SetDiagHandler(), SetDiagStream(), SetLogFile(), CDiagContext::SetupDiag(), CLogLatencyReport::Start(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), CBlastAppDiagHandler::~CBlastAppDiagHandler(), CDiagRecycler::~CDiagRecycler(), CDiagRestorer::~CDiagRestorer(), CLogLatencyReport::~CLogLatencyReport(), CNcbiToolkit::~CNcbiToolkit(), and CwxLogDiagHandler::~CwxLogDiagHandler().
◆ SetDiagHandler() [2/2] ◆ SetDiagPostAllFlags() ◆ SetDiagPostFlag()Set the specified flag (globally).
Definition at line 6175 of file ncbidiag.cpp.
References s_SetDiagPostFlag().
Referenced by CCgiApplication::CCgiApplication(), Cn3DApp::Cn3DApp(), SGridWorkerNodeImpl::Init(), CCgiApplication::Init(), Cn3DNoWin::Init(), CBDB_PhoneBookDemo1::Init(), CBDB_PhoneBookDemo2::Init(), CBDB_PhoneBookDemo3::Init(), CBDB_BLobDemo1::Init(), CBDB_SplitTest::Init(), CBDB_MergeTest::Init(), CTestApplication::Init(), CSampleNetScheduleClient::Init(), CSampleNetScheduleNode::Init(), main(), CRemoteAppListener::OnInit(), CXcompareAnnotsApplication::Run(), BlastdbCopyApplication::Run(), CId1FetchApp::Run(), and CId2FetchApp::Run().
◆ SetDiagPostLevel()Set the threshold severity for posting the messages.
This function has effect only if:
Another way to do filtering is to call SetDiagFilter
Special case: eDiag_Trace – print all messages and turn on the tracing.
Definition at line 6234 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 )Specify a string to prefix all subsequent error postings with.
Definition at line 6202 of file ncbidiag.cpp.
References buf, and GetDiagBuffer().
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CSeedTopApp::Run(), CTblastnApp::Run(), CTblastxApp::Run(), CBlastdbConvertApp::Run(), CMakeBlastDBApp::Run(), CMakeClusterDBApp::Run(), CBlastVdbCmdApp::Run(), CMagicBlastApp::Run(), CBlastKmerBuildIndexApplication::Run(), CBlastDbCheckApplication::Run(), BlastdbCopyApplication::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitQuery(), and CRPSTBlastnApp::x_RunMTBySplitQuery().
◆ SetDiagRequestId() void SetDiagRequestId ( Uint8 id ) ◆ SetDiagStream()Set diagnostic stream.
Error diagnostics are written to output stream "os". This uses the SetDiagHandler() functionality.
Definition at line 8190 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(), 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()Set the diagnostic trace settings.
Definition at line 6331 of file ncbidiag.cpp.
References eDT_Default, eDT_Enable, and CDiagLock::eWrite.
Referenced by CNcbiApplicationAPI::AppMain(), Cn3DApp::Cn3DApp(), CCgiApplication::ConfigureDiagThreshold(), GetAsnDataViaHTTP(), Cn3DNoWin::Init(), CBDB_SplitTest::Init(), CBDB_MergeTest::Init(), CTestApplication::Init(), main(), ReadASNFromFile(), CGridCommandLineInterfaceApp::Run(), CXcompareAnnotsApplication::Run(), CWinMaskDemoApplication::Run(), SetDiagPostLevel(), WriteASNToFile(), and CNcbiApplicationAPI::x_HonorStandardSettings().
◆ SetDiagTraceAllFlags() ◆ SetDiagTraceFlag() ◆ SetDiagUserAndHost()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().
◆ SetDisabledAppLog() void CRequestContext::SetDisabledAppLog ( bool disable ) inline ◆ SetDisabledAppLogEvents() ◆ SetDoubleDiagHandler() void SetDoubleDiagHandler ( void ) ◆ SetDtab() ◆ SetErrorCode() ◆ SetExitCode() void CDiagContext::SetExitCode ( int exit_code ) inline ◆ SetExitSignal() void CDiagContext::SetExitSignal ( int exit_sig ) inline ◆ SetFastCGIIteration() void SetFastCGIIteration ( Uint8 id ) inline ◆ SetFile() [1/2] ◆ SetFile() [2/2] ◆ SetFunction() [1/2] ◆ SetFunction() [2/2] void CDiagCompileInfo::SetFunction ( const string & func ) private ◆ SetGlobalAppState() ◆ SetHitID() [1/2] ◆ SetHitId() ◆ SetHitID() [2/2] ◆ SetHostIP() ◆ SetHostname() void CDiagContext::SetHostname ( const string & hostname ) ◆ SetHttpHeader() [1/3] ◆ SetHttpHeader() [2/3] ◆ SetHttpHeader() [3/3] ◆ SetLine() [1/2] void CDiagCompileInfo::SetLine ( int line ) private ◆ SetLine() [2/2] ◆ SetLogFile() [1/2]Set new log file.
Definition at line 6989 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]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 7635 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()Definition at line 1482 of file ncbidiag.cpp.
References CRequestRateControl::eDiscrete, CRequestRateControl::eErrCode, CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, CDiagContext::GetLogRate_Period(), CDiagContext::m_AppLogRC, CDiagContext::m_AppLogSuspended, CDiagContext::m_ErrLogRC, CDiagContext::m_ErrLogSuspended, CDiagContext::m_TraceLogRC, CDiagContext::m_TraceLogSuspended, s_AppLogRateLimit, s_ErrLogRateLimit, and s_TraceLogRateLimit.
Referenced by NcbiSys_main().
◆ SetLogRate_Period() void CDiagContext::SetLogRate_Period ( ELogRate_Type type, unsigned int period )Definition at line 1536 of file ncbidiag.cpp.
References CRequestRateControl::eDiscrete, CRequestRateControl::eErrCode, CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, CDiagContext::GetLogRate_Limit(), CDiagContext::m_AppLogRC, CDiagContext::m_AppLogSuspended, CDiagContext::m_ErrLogRC, CDiagContext::m_ErrLogSuspended, CDiagContext::m_TraceLogRC, CDiagContext::m_TraceLogSuspended, s_AppLogRatePeriod, s_ErrLogRatePeriod, and s_TraceLogRatePeriod.
◆ SetLogTruncate() void CDiagContext::SetLogTruncate ( bool value ) static ◆ SetModule() [1/2] ◆ SetModule() [2/2] void CDiagCompileInfo::SetModule ( const string & module ) private ◆ SetName() [1/3] void CJaegerTracerSpan::SetName ( const string & name ) inlineoverridevirtual ◆ SetName() [2/3] void COpentelemetryTracerSpan::SetName ( const string & name ) overridevirtual ◆ SetName() [3/3] ◆ SetOldPostFormat() void CDiagContext::SetOldPostFormat ( bool value ) static ◆ SetOmitStackTrace() void CNcbiDiag::SetOmitStackTrace ( bool value ) inline ◆ SetON() void CPerfLogger::SetON ( bool enable =true
) static
Turn performance logging on/off globally.
Definition at line 64 of file perf_log.cpp.
◆ SetOwnership() ◆ SetPostFlags() [1/2] ◆ SetPostFlags() [2/2]Set specific post flags for the current message.
◆ SetPrintSeverity() void CDiagCollectGuard::SetPrintSeverity ( EDiagSev sev ) ◆ SetProperty() [1/2] ◆ SetProperty() [2/2]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.
Definition at line 2033 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 ) inlineSwitch 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 416 of file request_ctx.hpp.
References CRequestContext::m_IsReadOnly.
Referenced by CPSGS_Request::SetRequestContext(), and CPubseqGatewayApp::x_SelfZEndPointCheckImpl().
◆ SetRequestContext()Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()
Definition at line 2009 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 ) inlineSet request ID.
Definition at line 721 of file request_ctx.hpp.
References CRequestContext::eProp_RequestID, CRequestContext::m_RequestID, CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_SetProp().
Referenced by CGRPCServerCallbacks::BeginRequest(), CDiagContextThreadData::IncRequestId(), SDiagMessage::SDiagMessage(), SetDiagRequestId(), CDiagContextThreadData::SetRequestId(), SNewRequestContext::SNewRequestContext(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CExpiredCleaner::x_DeleteNextData(), CBulkCleaner::x_Finalize(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetScheduleHandler::x_ProcessMsgRequest(), SWorkerNodeJobContextImpl::x_RunJob(), and SOfflineJobContextImpl::x_RunJob().
◆ SetRequestID() [2/2] ◆ SetRequestStatus() [1/2] ◆ SetRequestStatus() [2/2] void CRequestContext::SetRequestStatus ( int status ) inlineDefinition at line 909 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() ◆ SetSessionID() [1/2] void CRequestContext::SetSessionID ( const string & session )Definition at line 472 of file request_ctx.cpp.
References CRequestContext::eOnBadSID_Allow, CRequestContext::eOnBadSID_AllowAndReport, CRequestContext::eOnBadSID_Ignore, CRequestContext::eOnBadSID_IgnoreAndReport, CRequestContext::eOnBadSID_Throw, CRequestContext::eProp_SessionID, ERR_POST_X, CRequestContext::GetBadSessionIDAction(), CRequestContext::IsValidSessionID(), CRequestContext::m_SessionID, NCBI_THROW, CEncodedString::SetString(), Warning(), CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_SetProp().
Referenced by SNSCommandArguments::AssignValues(), CCgiContext::RetrieveTrackingId(), SGridWorkerNodeImpl::Run(), s_GetRequestID(), CDiagContext::SetProperty(), SetSessionAndIPAndPHID(), CNCMessageHandler::x_AssignCmdParams(), CNetScheduleHandler::x_LogCommandWithJob(), CNetScheduleHandler::x_PrintCmdRequestStart(), and SWorkerNodeJobContextImpl::x_RunJob().
◆ SetSessionID() [2/2] ◆ SetSeverityCap() void CDiagCollectGuard::SetSeverityCap ( EDiagSev sev ) inline ◆ SetShared() void CSharedHitId::SetShared ( void ) const inline ◆ SetSpanStatus() [1/3] void CJaegerTracerSpan::SetSpanStatus ( ESpanStatus status ) overridevirtual ◆ SetSpanStatus() [2/3] void COpentelemetryTracerSpan::SetSpanStatus ( ESpanStatus status ) overridevirtual ◆ SetSpanStatus() [3/3] ◆ SetSplitLogFile() void SetSplitLogFile ( bool value =true
) ◆ SetSrcTraceParent() void CRequestContext::SetSrcTraceParent ( const string & parent ) inline ◆ SetSrcTraceState() void CRequestContext::SetSrcTraceState ( const string & state ) inline ◆ SetStatus() void CRequestContextGuard_Base::SetStatus ( int status ) inline ◆ SetSubHandler()
Definition at line 7121 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_OwnErr, CFileDiagHandler::m_OwnLog, CFileDiagHandler::m_OwnPerf, CFileDiagHandler::m_OwnTrace, CFileDiagHandler::m_Perf, CFileDiagHandler::m_Trace, and CFileDiagHandler::x_SetHandler().
◆ SetTracerSpan() ◆ SetTracerSpanKind() ◆ SetType() ◆ SetupDiag()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 3647 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 ) ◆ SetUseRootLog() void CDiagContext::SetUseRootLog ( void ) static ◆ Severity() ◆ SeverityName()Get a common symbolic name for the severity levels.
Referenced by CJsonResponse::AddMessage(), CPSGS_CassProcessorBase::CountError(), CFlatFileMessage::Dump(), CAnnotWriterLogger::DumpMessage(), CMessageHandlerDefault::HandleMessage(), COpentelemetryTracerSpan::PostEvent(), s_GetSeverityName(), ILineError::SeverityStr(), CDB_Exception::SeverityString(), SeverityToLowerString(), sGetSeverityName(), CNcbiDiag::StrToSeverityLevel(), CMessage_Basic::Write(), CObjtoolsDiagMessage::WriteAsXML(), CObjEditMessage::x_GetSeverityString(), SDiagMessage::x_NewWrite(), SDiagMessage::x_OldWrite(), and CReportLoaderErrorsEx::x_UpdateHTMLResults().
◆ Start() [1/2] void CPerfLogger::Start ( void ) inlineActivate and start (or, restart after Suspend()) the timer.
Definition at line 397 of file perf_log.hpp.
References ERR_POST_ONCE, Error(), CStopWatch::eStart, GetFastLocalTime(), CTime::IsEmpty(), CPerfLogger::IsON(), CPerfLogger::m_FirstStartTime, CPerfLogger::m_LastStartTime, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, CStopWatch::Start(), and CPerfLogger::x_CheckValidity().
Referenced by CPerfLogger::CPerfLogger(), and CPerfLogGuard::Start().
◆ Start() [2/2] void CPerfLogGuard::Start ( void ) inline ◆ StartRequest() void CRequestContext::StartRequest ( void ) privateDefinition at line 355 of file request_ctx.cpp.
References CRequestContext::fResetOnStart, CRequestContext::GetRequestTimer(), CRequestContext::m_Flags, CRequestContext::m_IsRunning, CRequestContext::m_Tracer, CStopWatch::Restart(), CRequestContext::SetBytesRd(), CRequestContext::SetBytesWr(), CRequestContext::sm_Tracer, CRequestContext::UnsetRequestStatus(), CRequestContext::x_CanModify(), CRequestContext::x_LoadEnvContextProperties(), and CRequestContext::x_LogHitID().
◆ StopRequest() void CRequestContext::StopRequest ( void ) private ◆ StrToSeverityLevel()Get severity from string.
Definition at line 8011 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 ) inlineSuspend the timer.
Call Start() to continue to count time accured before.
Definition at line 420 of file perf_log.hpp.
References CTime::DiffTimeSpan(), CStopWatch::eStop, CTimeSpan::GetAsDouble(), GetFastLocalTime(), CPerfLogger::IsON(), CPerfLogger::m_Elapsed, CPerfLogger::m_LastStartTime, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, CStopWatch::Stop(), and CPerfLogger::x_CheckValidity().
Referenced by CPerfLogger::Post(), and CPerfLogGuard::Suspend().
◆ Suspend() [2/2] void CPerfLogGuard::Suspend ( void ) inline ◆ sx_GetContextFieldsMask() const CMask & CRequestContext::sx_GetContextFieldsMask ( void ) staticprivate ◆ sx_GetDefaultAutoIncRequestIDOnPost() bool & CRequestContext::sx_GetDefaultAutoIncRequestIDOnPost ( void ) staticprivate ◆ sx_NormalizeContextPropertyName() ◆ sx_ThreadDataTlsCleanup() ◆ UnsetBytesRd() void CRequestContext::UnsetBytesRd ( void ) inline ◆ UnsetBytesWr() void CRequestContext::UnsetBytesWr ( void ) inline ◆ UnsetClientIP() void CRequestContext::UnsetClientIP ( void ) inline ◆ UnsetDiagPostFlag() ◆ UnsetDiagTraceFlag() ◆ UnsetDtab() void CRequestContext::UnsetDtab ( void ) inline ◆ UnsetHitID() void CRequestContext::UnsetHitID ( void ) inline ◆ UnsetProperty() void CRequestContext::UnsetProperty ( const string & name ) ◆ UnsetRequestID() void CRequestContext::UnsetRequestID ( void ) inline ◆ UnsetRequestStatus() void CRequestContext::UnsetRequestStatus ( void ) inline ◆ UnsetSessionID() void CRequestContext::UnsetSessionID ( void ) inline ◆ UpdateOnFork()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.
Definition at line 826 of file logging.cpp.
References CDiagContext::UpdatePID().
Referenced by CCurrentProcess::Fork().
◆ UpdatePID() bool CDiagContext::UpdatePID ( void ) staticReset PID cache (e.g. after fork). Return true if PID was updated.
Definition at line 832 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()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 1804 of file ncbidiag.cpp.
References CDiagContext::GetUID(), and t.
◆ UseSystemThreadId() void CDiagContext::UseSystemThreadId ( bool value =true
) static ◆ Valid() bool CFileHandleDiagHandler::Valid ( void ) inline ◆ Write() [1/2] ◆ Write() [2/2] ◆ WriteMessage() [1/3] ◆ WriteMessage() [2/3] void CFileHandleDiagHandler::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 6781 of file ncbidiag.cpp.
References buf, CStopWatch::Elapsed(), CDiagHandler::fDefault, CDiagFileHandleHolder::GetHandle(), CStopWatch::IsRunning(), kLogReopenDelay, len, CFileHandleDiagHandler::m_Handle, CFileHandleDiagHandler::m_ReopenTimer, NcbiSys_write, CFileHandleDiagHandler::Reopen(), and s_ReopenEntered.
◆ WriteMessage() [3/3] void CFileDiagHandler::WriteMessage ( const char * buf, size_t len, EDiagFileType file_type ) virtualWrite string to the log.
The string may contain multiple messages of the same type.
Reimplemented from CDiagHandler.
Definition at line 7248 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()Write standard prefix to the stream.
Use values from the message (PID/TID/RID etc.).
Definition at line 3265 of file ncbidiag.cpp.
References client, CDiagContext::GetStringUID(), kDiagTimeFormat, kDiagW_AppState, kDiagW_Client, kDiagW_Host, kDiagW_PID, kDiagW_RID, kDiagW_Session, kDiagW_SN, kDiagW_TID, kUnknown_App, kUnknown_Client, kUnknown_Host, kUnknown_Session, msg(), and s_AppStateToStr().
Referenced by SDiagMessage::x_NewWrite().
◆ x_CanModify() bool CRequestContext::x_CanModify ( void ) const inlineprivateDefinition at line 1042 of file request_ctx.hpp.
References ERR_POST_ONCE, and CRequestContext::m_IsReadOnly.
Referenced by CRequestContext::AddPassThroughProperty(), CRequestContext::GetNextSubHitID(), CRequestContext::Reset(), CRequestContext::SetAppState(), CRequestContext::SetBytesRd(), CRequestContext::SetBytesWr(), CRequestContext::SetClientIP(), CRequestContext::SetDtab(), CRequestContext::SetHitID(), CRequestContext::SetProperty(), CRequestContext::SetRequestID(), CRequestContext::SetRequestStatus(), CRequestContext::SetSessionID(), CRequestContext::StartRequest(), CRequestContext::StopRequest(), CRequestContext::UnsetBytesRd(), CRequestContext::UnsetBytesWr(), CRequestContext::UnsetClientIP(), CRequestContext::UnsetDtab(), CRequestContext::UnsetHitID(), CRequestContext::UnsetProperty(), CRequestContext::UnsetRequestID(), CRequestContext::UnsetRequestStatus(), CRequestContext::UnsetSessionID(), CRequestContext::x_GetHitID(), CRequestContext::x_LoadEnvContextProperties(), CRequestContext::x_ResetPassThroughProp(), CRequestContext::x_SetHitID(), and CRequestContext::x_SetPassThroughProp().
◆ x_CanPrint() bool CDiagContext_Extra::x_CanPrint ( void ) private ◆ x_CheckValidity() ◆ 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 privatePrivate 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 ◆ x_GetDefaultHitID()Definition at line 3099 of file ncbidiag.cpp.
References _ASSERT, CDiagContext::eHitID_Create, CDiagContext::m_DefaultHitId, CDiagContext::m_LoggedHitId, NPOS, s_HitId, s_HttpHitId, CRequestContext::SelectLastHitID(), string, CDiagContext::x_GetNextHitID(), and CDiagContext::x_LogHitID().
Referenced by CDiagContext::PrintStart(), and CRequestContext::x_GetHitID().
◆ x_GetDiagFileType()Definition at line 7172 of file ncbidiag.cpp.
References eDiag_Info, eDiag_Trace, eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, eDPF_AppLog, SDiagMessage::eEvent_PerfLog, IsSetDiagPostFlag(), and msg().
Referenced by CFileDiagHandler::AllowAsyncWrite(), CFileDiagHandler::ComposeMessage(), and CFileDiagHandler::Post().
◆ x_GetHandler()Definition at line 7193 of file ncbidiag.cpp.
References 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 CFileDiagHandler::AllowAsyncWrite(), CFileDiagHandler::ComposeMessage(), CFileDiagHandler::Post(), and CFileDiagHandler::WriteMessage().
◆ x_GetHitID()Definition at line 229 of file request_ctx.cpp.
References CDiagContext::eHitID_NoCreate, CSharedHitId::Empty(), CRequestContext::eProp_HitID, GetDiagContext(), CSharedHitId::GetHitId(), kEmptyStr, CRequestContext::m_HitID, CRequestContext::SetHitID(), CRequestContext::x_CanModify(), CDiagContext::x_GetDefaultHitID(), CRequestContext::x_IsSetProp(), CRequestContext::x_LogHitID(), and CRequestContext::x_SetHitID().
Referenced by CRequestContext::GetHitID(), and CRequestContext::StopRequest().
◆ x_GetModule() string SDiagMessage::x_GetModule ( void ) const ◆ x_GetNextHitID() string CDiagContext::x_GetNextHitID ( bool is_default ) const private ◆ x_GetPassThroughProp() ◆ x_Init() [1/2]Definition at line 575 of file ncbidiag.cpp.
References CDiagContextThreadData::AddCollectGuard(), CompareDiagPostLevel(), ePostNumber_NoIncrement, CDiagContextThreadData::GetCollectGuard(), CDiagCollectGuard::GetCollectSeverity(), CDiagCollectGuard::GetPrintSeverity(), CDiagContextThreadData::GetThreadData(), CDiagContext::GetThreadPostNumber(), CDiagCollectGuard::m_Action, CDiagCollectGuard::m_CollectSev, CDiagCollectGuard::m_PrintSev, CDiagCollectGuard::m_SeverityCap, and CDiagCollectGuard::m_StartingPoint.
Referenced by CDiagCollectGuard::CDiagCollectGuard().
◆ x_Init() [2/2] void COpentelemetryTracer::x_Init ( void ) private ◆ x_InitData() void SDiagMessage::x_InitData ( void ) const privateDefinition at line 6020 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetUID(), CTime::IsEmpty(), SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessageData::m_Class, SDiagMessage::m_Data, SDiagMessage::m_ErrText, SDiagMessageData::m_ErrText, SDiagMessage::m_File, SDiagMessageData::m_File, SDiagMessage::m_Function, SDiagMessageData::m_Function, SDiagMessageData::m_Message, SDiagMessage::m_Module, SDiagMessageData::m_Module, SDiagMessage::m_Prefix, SDiagMessageData::m_Prefix, SDiagMessageData::m_Time, SDiagMessageData::m_UID, s_GetFastTime(), and string.
Referenced by SDiagMessage::x_SaveContextData().
◆ x_InitOtlp() void COpentelemetryTracer::x_InitOtlp ( const string & endpoint ) private ◆ x_InitStream() void COpentelemetryTracer::x_InitStream ( ostream & ostr ) private ◆ x_IsSetDefaultHitID() bool CDiagContext::x_IsSetDefaultHitID ( void ) const private ◆ x_IsSetOldFormat() bool SDiagMessage::x_IsSetOldFormat ( void ) const inlineprivate ◆ x_IsSetPassThroughProp() ◆ x_IsSetProp()Definition at line 1011 of file request_ctx.hpp.
References CRequestContext::m_PropSet, and true.
Referenced by CRequestContext::GetBytesRd(), CRequestContext::GetBytesWr(), CRequestContext::GetClientIP(), CRequestContext::GetDtab(), CRequestContext::GetEncodedSessionID(), CRequestContext::GetRequestID(), CRequestContext::GetRequestStatus(), CRequestContext::GetSessionID(), CRequestContext::IsSetBytesRd(), CRequestContext::IsSetBytesWr(), CRequestContext::IsSetDtab(), CRequestContext::IsSetExplicitClientIP(), CRequestContext::IsSetExplicitSessionID(), CRequestContext::IsSetHitID(), CRequestContext::IsSetRequestID(), CRequestContext::IsSetRequestStatus(), and CRequestContext::x_GetHitID().
◆ x_LoadEnvContextProperties() void CRequestContext::x_LoadEnvContextProperties ( void ) privateDefinition at line 840 of file request_ctx.cpp.
References NStr::eNocase, env, CNcbiApplicationAPI::GetEnvironment(), map_checker< Container >::insert(), CNcbiApplicationAPI::InstanceGuard(), ITERATE, CRequestContext::m_PassThroughProperties, mask, names, CRequestContext::sm_EnvContextProperties, CRequestContext::sx_GetContextFieldsMask(), CRequestContext::sx_NormalizeContextPropertyName(), and CRequestContext::x_CanModify().
Referenced by CRequestContext::CRequestContext(), CRequestContext::Reset(), and CRequestContext::StartRequest().
◆ x_LogEnvironment() void CDiagContext::x_LogEnvironment ( void ) staticprivateDefinition at line 3323 of file ncbidiag.cpp.
References env, CDiagContext::Extra(), CDiagContext_Extra::Flush(), NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, IRegistry::Get(), CSafeStatic< T, Callbacks >::Get(), CNcbiApplicationAPI::GetConfig(), GetDiagContext(), CNcbiApplicationAPI::GetEnvironment(), CNcbiApplicationAPI::InstanceGuard(), ITERATE, NCBI_PARAM_TYPE(), CDiagContext_Extra::Print(), NStr::Split(), NStr::SplitInTwo(), and val.
Referenced by CDiagContext::PrintStart(), and CDiagContext::x_StartRequest().
◆ x_LogHitID() [1/2] void CRequestContext::x_LogHitID ( bool ignore_app_state =false
) const private
Definition at line 200 of file request_ctx.cpp.
References eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, CSharedHitId::Empty(), eNcbiStrings_PHID, CDiagContext::Extra(), CRequestContext::fLoggedOnRequest, g_GetNcbiString(), GetDiagContext(), CSharedHitId::GetHitId(), CRequestContext::m_AppState, CRequestContext::m_HitID, CRequestContext::m_HitIDLoggedFlag, and CDiagContext_Extra::Print().
Referenced by CRequestContext::StartRequest(), CRequestContext::x_GetHitID(), and CRequestContext::x_SetHitID().
◆ x_LogHitID() [2/2] void CDiagContext::x_LogHitID ( void ) const private ◆ x_LogHitID_WithLock() void CDiagContext::x_LogHitID_WithLock ( void ) const private ◆ x_LogHitIDOnError() bool CRequestContext::x_LogHitIDOnError ( void ) const inlineprivate ◆ x_Match() ◆ x_Modify() void CRequestContext::x_Modify ( void ) inlineprivateDefinition at line 1053 of file request_ctx.hpp.
References CAtomicCounter::Add(), CRequestContext::m_Version, and CRequestContext::sm_VersionCounter.
Referenced by CRequestContext::SetClientIP(), CRequestContext::SetRequestID(), CRequestContext::SetSessionID(), CRequestContext::UnsetClientIP(), CRequestContext::UnsetHitID(), CRequestContext::UnsetRequestID(), CRequestContext::UnsetSessionID(), CRequestContext::x_SetHitID(), and CRequestContext::x_UpdateSubHitID().
◆ x_NeedModule() bool CDiagCompileInfo::x_NeedModule ( void ) const private ◆ x_NewWrite()Definition at line 5863 of file ncbidiag.cpp.
References buf, eDPF_AppLog, eDPF_ErrCodeExplanation, eDPF_ErrCodeMessage, eDPF_ErrCodeUseSeverity, eDPF_IsNote, eDPF_LongFilename, eDPF_OmitSeparator, eDPF_Prefix, flags, SDiagMessage::fNoEndl, SDiagMessage::fNoPrefix, SDiagMessage::FormatExtraMessage(), GetDiagContext(), GetDiagErrCodeInfo(), SDiagMessage::GetEventName(), info, IsSetDiagErrCodeInfo(), IsSetDiagPostFlag(), SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessage::m_ErrCode, SDiagMessage::m_ErrSubCode, SDiagMessage::m_ErrText, SDiagMessage::m_Event, SDiagErrCodeDescription::m_Explanation, SDiagMessage::m_ExtraArgs, SDiagMessage::m_File, SDiagMessage::m_Flags, SDiagMessage::m_Function, SDiagMessage::m_Line, SDiagErrCodeDescription::m_Message, SDiagMessage::m_Module, SDiagMessage::m_Prefix, SDiagMessage::m_PrintStackTrace, SDiagMessage::m_Severity, SDiagErrCodeDescription::m_Severity, SDiagMessage::s_EscapeNewlines(), s_FormatStackTrace(), s_MaxLineLength, CNcbiDiag::SeverityName(), CDiagContext::WriteStdPrefix(), and SDiagMessage::x_GetModule().
◆ x_OldWrite()Definition at line 5675 of file ncbidiag.cpp.
References CTime::AsString(), buf, eDiag_Info, eDiagMergeLines_Off, eDiagMergeLines_On, eDPF_DateTime, eDPF_ErrCodeExplanation, eDPF_ErrCodeMessage, eDPF_ErrCodeMsgInFront, eDPF_ErrCodeUseSeverity, eDPF_ErrorID, eDPF_File, eDPF_IsNote, eDPF_Line, eDPF_Location, eDPF_LongFilename, eDPF_MergeLines, eDPF_OmitInfoSev, eDPF_Prefix, eDPF_Severity, eDPF_TID, flags, SDiagMessage::fNoEndl, CSafeStatic< T, Callbacks >::Get(), GetDiagErrCodeInfo(), CFastLocalTime::GetLocalTime(), CThread::GetSelf(), if(), info, IsSetDiagErrCodeInfo(), IsSetDiagPostFlag(), SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessage::m_ErrCode, SDiagMessage::m_ErrSubCode, SDiagMessage::m_ErrText, SDiagErrCodeDescription::m_Explanation, SDiagMessage::m_File, SDiagMessage::m_Flags, SDiagMessage::m_Function, SDiagMessage::m_Line, SDiagErrCodeDescription::m_Message, SDiagMessage::m_Module, SDiagMessage::m_Prefix, SDiagMessage::m_PrintStackTrace, SDiagMessage::m_Severity, SDiagErrCodeDescription::m_Severity, NCBI_PARAM_TYPE(), NcbiEndl, NStr::ReplaceInPlace(), s_FormatStackTrace(), CNcbiDiag::SeverityName(), and SDiagMessage::x_GetModule().
Referenced by CTeeDiagHandler::Post().
◆ x_ParseExtraArgs()Definition at line 4948 of file ncbidiag.cpp.
References IStringDecoder::Decode(), IStringDecoder::eName, CStringPairs< TContainer >::GetDecoder(), CStringPairs< TContainer >::GetPairs(), ITERATE, kExtraTypeArgName, SDiagMessage::m_ExtraArgs, SDiagMessage::m_TypedExtra, n, NPOS, CStringPairs< TContainer >::Parse(), NStr::SplitInTwo(), and str().
Referenced by SDiagMessage::ParseMessage().
◆ x_PrintMessage()Definition at line 3376 of file ncbidiag.cpp.
References ctx, eDiag_Info, SDiagMessage::eEvent_Extra, SDiagMessage::eEvent_RequestStart, SDiagMessage::eEvent_RequestStop, SDiagMessage::eEvent_Start, SDiagMessage::eEvent_Stop, ERR_POST, ERR_POST_ONCE, CNcbiDiag::ForceImportantFlags(), CDiagContext::GetExitCode(), CDiagContext::GetExitSignal(), CDiagContext::GetRequestContext(), CDiagContext::IsSetOldPostFormat(), kApplogDiagPostFlags, SDiagMessage::m_Event, CDiagContext::m_StopWatch, NULL, s_IsDisabledAppLogEvent(), str(), Warning(), and CDiagContext::x_StartRequest().
Referenced by CDiagContext::PrintExtra(), CDiagContext::PrintProperties(), CDiagContext::PrintRequestStart(), CDiagContext::PrintRequestStop(), CDiagContext::PrintStart(), CDiagContext::PrintStop(), and CDiagContext::SetProperty().
◆ x_Put()Helper func for the exception-related Put()
Definition at line 7924 of file ncbidiag.cpp.
References AdjustApplogPrintableSeverity(), CNcbiDiag::CheckFilters(), CompareDiagPostLevel(), eDPF_IsConsole, CException::fConsole, CException::GetClass(), CDiagContextThreadData::GetCollectGuard(), CDiagCollectGuard::GetCollectSeverity(), CException::GetErrCode(), CException::GetErrCodeString(), CException::GetFile(), CException::GetFunction(), CException::GetLine(), CException::GetModule(), CNcbiDiag::GetPostFlags(), CException::GetPredecessor(), CDiagCollectGuard::GetPrintSeverity(), CNcbiDiag::GetSeverity(), CException::GetSeverity(), CException::GetStackTrace(), CDiagContextThreadData::GetThreadData(), CException::GetType(), CException::HasMainText(), IsOssEmpty(), CException::IsSetFlag(), CNcbiDiag::m_Buffer, SDiagMessage::m_Flags, CNcbiDiag::m_OmitStackTrace, NULL, s_FormatStackTrace(), s_GetExceptionText(), and text().
Referenced by CNcbiDiag::Put().
◆ x_Release() void CDiagContext_Extra::x_Release ( void ) private ◆ x_ResetHandler() ◆ x_ResetPassThroughProp() void CRequestContext::x_ResetPassThroughProp ( CTempString name, bool update ) const private ◆ x_SaveContextData() void SDiagMessage::x_SaveContextData ( void ) const privateDefinition at line 6056 of file ncbidiag.cpp.
References CDiagContext::GetAppState(), CRequestContext::GetClientIP(), GetDiagContext(), CDiagContext::GetEncodedAppName(), CDiagContext::GetEncodedHost(), CDiagContext::GetEncodedSessionID(), CDiagContext::GetRequestContext(), SDiagMessageData::m_AppName, SDiagMessageData::m_AppState, SDiagMessageData::m_Client, SDiagMessage::m_Data, SDiagMessageData::m_Host, SDiagMessageData::m_Session, and SDiagMessage::x_InitData().
Referenced by SDiagMessage::operator=().
◆ x_SerializeUrlEncoded() string CRequestContext_PassThrough::x_SerializeUrlEncoded ( void ) const private ◆ x_SetFormat() void SDiagMessage::x_SetFormat ( EFormatFlag fmt ) const inlineprivate ◆ x_SetHandler() ◆ x_SetHitID()Definition at line 413 of file request_ctx.cpp.
References CRequestContext::eProp_HitID, ERR_POST_X, CRequestContext::fLoggedOnRequest, CSharedHitId::GetHitId(), CRequestContext::m_HitID, CRequestContext::m_HitIDLoggedFlag, CRequestContext::m_SubHitIDCache, Warning(), CRequestContext::x_CanModify(), CRequestContext::x_LogHitID(), CRequestContext::x_Modify(), and CRequestContext::x_SetProp().
Referenced by CRequestContext::SetHitID(), and CRequestContext::x_GetHitID().
◆ x_SetHitId() void CSharedHitId::x_SetHitId ( const string & hit_id ) privateSet new hit id, checks its validity.
Definition at line 130 of file request_ctx.cpp.
References eOnBadPHID_Allow, eOnBadPHID_AllowAndReport, eOnBadPHID_Ignore, eOnBadPHID_IgnoreAndReport, eOnBadPHID_Throw, ERR_POST_X, NStr::fSS_alnum, NStr::fSS_NoMerge, CSafeStatic< T, Callbacks >::Get(), CSharedHitId::GetHitId(), IsValidHitID(), kAllowedIdMarkchars, CSharedHitId::m_HitId, NCBI_THROW, NStr::PrintableString(), NStr::Sanitize(), and Warning().
Referenced by CSharedHitId::CSharedHitId(), and CSharedHitId::SetHitId().
◆ x_SetPassThroughProp() ◆ x_SetProp() void CRequestContext::x_SetProp ( EProperty prop ) inlineprivate ◆ x_StartRequest() void CDiagContext::x_StartRequest ( void ) staticprivate ◆ x_TranslateFacility()Definition at line 203 of file syslog.cpp.
References CSysLog::eAuth, CSysLog::eAuthPriv, CSysLog::eCron, CSysLog::eDaemon, CSysLog::eDefaultFacility, CSysLog::eFTP, CSysLog::eKernel, CSysLog::eLocal0, CSysLog::eLocal1, CSysLog::eLocal2, CSysLog::eLocal3, CSysLog::eLocal4, CSysLog::eLocal5, CSysLog::eLocal6, CSysLog::eLocal7, CSysLog::eLPR, CSysLog::eMail, CSysLog::eNews, CSysLog::eSysLog, CSysLog::eUser, CSysLog::eUUCP, and CSysLog::m_DefaultFacility.
Referenced by CSysLog::Post().
◆ x_TranslateFlags() int CSysLog::x_TranslateFlags ( TFlags flags ) staticprivateDefinition at line 150 of file syslog.cpp.
References ERR_POST_X, CSysLog::fAllFlags, CSysLog::fConnectNow, CSysLog::fCopyToStderr, CSysLog::fFallBackToConsole, CSysLog::fIncludePID, flags, CSysLog::fNoChildWait, CSysLog::fNoOverride, result, and Warning().
Referenced by CSysLog::x_Connect().
◆ x_UnsetProp() void CRequestContext::x_UnsetProp ( EProperty prop ) inlineprivate ◆ x_UpdateStdContextProp() void CRequestContext::x_UpdateStdContextProp ( CTempString name ) const privateDefinition at line 731 of file request_ctx.cpp.
References ctx, CTempString::empty(), NStr::EqualNocase(), kPassThrough_ClientIp, kPassThrough_Dtab, kPassThrough_Phid, kPassThrough_Sid, match(), CRequestContext::x_GetPassThroughProp(), and CRequestContext::x_IsSetPassThroughProp().
Referenced by CRequestContext_PassThrough::Deserialize(), CRequestContext::x_ResetPassThroughProp(), and CRequestContext::x_SetPassThroughProp().
◆ x_UpdateStdPassThroughProp() void CRequestContext::x_UpdateStdPassThroughProp ( CTempString name ) const privateDefinition at line 690 of file request_ctx.cpp.
References CTempString::empty(), NStr::EqualNocase(), CRequestContext::GetClientIP(), CRequestContext::GetCurrentSubHitID(), CRequestContext::GetDtab(), CRequestContext::GetNextSubHitID(), CRequestContext::GetSessionID(), CRequestContext::IsSetClientIP(), CRequestContext::IsSetDtab(), CRequestContext::IsSetHitID(), CRequestContext::IsSetSessionID(), kPassThrough_ClientIp, kPassThrough_Dtab, kPassThrough_Phid, kPassThrough_Sid, CRequestContext::x_ResetPassThroughProp(), and CRequestContext::x_SetPassThroughProp().
Referenced by CRequestContext_PassThrough::Enumerate(), CRequestContext_PassThrough::Serialize(), CRequestContext::x_GetPassThroughProp(), and CRequestContext::x_IsSetPassThroughProp().
◆ x_UpdateSubHitID() void CRequestContext::x_UpdateSubHitID ( bool increment, CTempString prefix ) privateDefinition at line 445 of file request_ctx.cpp.
References _ASSERT, CDiagContext::Extra(), CSharedHitId::GetCurrentSubHitId(), GetDiagContext(), CRequestContext::GetHitID(), CSharedHitId::GetNextSubHitId(), CRequestContext::IsSetHitID(), CRequestContext::m_HitID, CRequestContext::m_SubHitIDCache, NStr::NumericToString(), CDiagContext_Extra::Print(), and CRequestContext::x_Modify().
Referenced by CRequestContext::GetCurrentSubHitID(), and CRequestContext::GetNextSubHitID().
◆ ~CAsyncDiagHandler() CAsyncDiagHandler::~CAsyncDiagHandler ( void ) virtual ◆ ~CDiagAutoPrefix() CDiagAutoPrefix::~CDiagAutoPrefix ( void ) ◆ ~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 606 of file ncbidiag.cpp.
References CDiagCollectGuard::Release().
◆ ~CDiagCompileInfo() CDiagCompileInfo::~CDiagCompileInfo ( void ) ◆ ~CDiagContext() CDiagContext::~CDiagContext ( void ) ◆ ~CDiagContext_Extra() CDiagContext_Extra::~CDiagContext_Extra ( void ) ◆ ~CDiagErrCodeInfo() CDiagErrCodeInfo::~CDiagErrCodeInfo ( void )Destructor.
◆ ~CDiagFactory() virtual CDiagFactory::~CDiagFactory ( ) inlinevirtualDefinition at line 2939 of file ncbidiag.hpp.
◆ ~CDiagHandler() virtual CDiagHandler::~CDiagHandler ( void ) inlinevirtual ◆ ~CDiagRestorer() CDiagRestorer::~CDiagRestorer ( void )Restores captured settings.
Definition at line 8111 of file ncbidiag.cpp.
References buf, CDiagLock::eWrite, GetDiagBuffer(), CDiagRestorer::m_ApplogSeverityLocked, CDiagRestorer::m_CanDeleteErrCodeInfo, CDiagRestorer::m_CanDeleteHandler, CDiagRestorer::m_DieSeverity, CDiagRestorer::m_ErrCodeInfo, CDiagRestorer::m_Handler, CDiagRestorer::m_IgnoreToDie, CDiagRestorer::m_PostFlags, CDiagRestorer::m_PostPrefix, CDiagRestorer::m_PostSeverity, CDiagRestorer::m_PostSeverityChange, CDiagRestorer::m_PrefixList, CDiagRestorer::m_TraceDefault, CDiagRestorer::m_TraceEnabled, CDiagContext::SetApplogSeverityLocked(), SetDiagErrCodeInfo(), and SetDiagHandler().
◆ ~CFileDiagHandler() CFileDiagHandler::~CFileDiagHandler ( void ) ◆ ~CFileHandleDiagHandler() CFileHandleDiagHandler::~CFileHandleDiagHandler ( void ) ◆ ~CJaegerTracer() ◆ ~CNcbiDiag() CNcbiDiag::~CNcbiDiag ( void ) ◆ ~CNcbiLogFields() CNcbiLogFields::~CNcbiLogFields ( void )Definition at line 4018 of file ncbidiag.cpp.
◆ ~COpentelemetryTracer() ◆ ~COpentelemetryTracerSpan() ◆ ~CPerfLogger() CPerfLogger::~CPerfLogger ( ) inline ◆ ~CPerfLogGuard() CPerfLogGuard::~CPerfLogGuard ( ) inline ◆ ~CRequestContext() CRequestContext::~CRequestContext ( void ) virtualDefinition at line 188 of file request_ctx.cpp.
◆ ~CRequestContextGuard_Base() CRequestContextGuard_Base::~CRequestContextGuard_Base ( void )Destroy guard.
If released do nothing. On exception set error status. Print request-stop. Restore previous context.
Definition at line 954 of file request_ctx.cpp.
References ctx, CRequestStatus::e200_Ok, GetDiagContext(), CRef< C, Locker >::GetNonNullPointer(), CRequestContext::IsSetRequestStatus(), CRequestContextGuard_Base::m_ErrorStatus, CRequestContextGuard_Base::m_OriginatesFromThrow, CRequestContextGuard_Base::m_RequestContext, CRequestContextGuard_Base::m_SavedContext, CRequestContext::SetRequestStatus(), and CRequestContextGuard_Base::SetStatus().
◆ ~CSharedHitId() CSharedHitId::~CSharedHitId ( void ) inlineDefinition at line 75 of file request_ctx.hpp.
◆ ~CSysLog() ◆ ~INextDiagMessage() virtual INextDiagMessage::~INextDiagMessage ( void ) inlinevirtualDefinition at line 1578 of file ncbidiag.hpp.
◆ ~IRequestTracer() virtual IRequestTracer::~IRequestTracer ( void ) inlinevirtualDefinition at line 144 of file request_ctx.hpp.
◆ ~ITracerSpan() virtual ITracerSpan::~ITracerSpan ( void ) inlinevirtualDefinition at line 153 of file request_ctx.hpp.
◆ ~SDiagMessage() SDiagMessage::~SDiagMessage ( void ) ◆ key const char* SNcbiLog_Param::key ◆ kLogName_Syslog const char * CSysLog::kLogName_Syslog = "SYSLOG" static ◆ kProperty_AppName const char * CDiagContext::kProperty_AppName = "app_name" static ◆ kProperty_AppState const char * CDiagContext::kProperty_AppState = "app_state" static ◆ kProperty_BytesRd const char * CDiagContext::kProperty_BytesRd = "bytes_rd" static ◆ kProperty_BytesWr const char * CDiagContext::kProperty_BytesWr = "bytes_wr" static ◆ kProperty_ClientIP const char * CDiagContext::kProperty_ClientIP = "client_ip" static ◆ 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 ◆ kProperty_ReqTime const char * CDiagContext::kProperty_ReqTime = "request_time" static ◆ kProperty_SessionID const char * CDiagContext::kProperty_SessionID = "session_id" static ◆ kProperty_UserName const char * CDiagContext::kProperty_UserName = "user" static ◆ 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 ◆ m_ApplogSeverityLocked bool CDiagRestorer::m_ApplogSeverityLocked private ◆ m_AppLogSuspended atomic<bool> CDiagContext::m_AppLogSuspended private ◆ m_AppName ◆ m_AppNameSet bool CDiagContext::m_AppNameSet mutableprivate ◆ m_AppState [1/3] ◆ m_AppState [2/3] ◆ m_AppState [3/3] ◆ m_Args ◆ m_AsyncThread ◆ m_AutoIncOnPost bool CRequestContext::m_AutoIncOnPost private ◆ m_Buffer [1/2] CDiagBuffer& CNcbiDiag::m_Buffer private ◆ 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 ◆ m_CanDeleteHandler bool CDiagRestorer::m_CanDeleteHandler private ◆ m_Class [1/2] ◆ m_Class [2/2] const char* SDiagMessage::m_Class ◆ m_ClassName string CDiagCompileInfo::m_ClassName mutableprivate ◆ m_ClassSet bool CDiagCompileInfo::m_ClassSet mutableprivate ◆ m_ClientIP string CRequestContext::m_ClientIP private ◆ m_Code ◆ m_CollectSev EDiagSev CDiagCollectGuard::m_CollectSev private ◆ m_CompileInfo ◆ m_Context ◆ m_Counter int* CDiagContext_Extra::m_Counter private ◆ m_CurrFunctName const char* CDiagCompileInfo::m_CurrFunctName private ◆ m_DataDefinition at line 1752 of file ncbidiag.hpp.
Referenced by SDiagMessage::GetAppName(), SDiagMessage::GetAppState(), SDiagMessage::GetClient(), SDiagMessage::GetHost(), SDiagMessage::GetSession(), SDiagMessage::GetTime(), SDiagMessage::GetUID(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_SaveContextData(), and SDiagMessage::~SDiagMessage().
◆ m_DefaultFacility int CSysLog::m_DefaultFacility private ◆ m_DefaultHitId ◆ m_DefaultSessionId ◆ m_DieSeverity ◆ m_DisabledAppLog bool CRequestContext::m_DisabledAppLog private ◆ m_DisabledAppLogEvents ◆ m_Dtab string CRequestContext::m_Dtab private ◆ m_Elapsed double CPerfLogger::m_Elapsed private ◆ m_Err ◆ m_ErrCode [1/2] ◆ m_ErrCode [2/2] int SDiagMessage::m_ErrCode ◆ m_ErrCodeInfo ◆ m_ErrLogRC ◆ 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 ◆ m_ErrSubCode [2/2] int SDiagMessage::m_ErrSubCode ◆ m_ErrText const char* SDiagMessage::m_ErrText ◆ m_Event ◆ m_EventType ◆ m_ExitCode int CDiagContext::m_ExitCode private ◆ m_ExitCodeSet bool CDiagContext::m_ExitCodeSet private ◆ m_ExitSig int CDiagContext::m_ExitSig private ◆ m_Explanation string SDiagErrCodeDescription::m_Explanation ◆ m_ExtraArgs ◆ m_Fields ◆ m_File [1/2] const char* CDiagCompileInfo::m_File private ◆ m_File [2/2] const char* SDiagMessage::m_File ◆ m_FileType ◆ m_FirstStartTime CTime CPerfLogger::m_FirstStartTime private ◆ m_Flags [1/5] ◆ m_Flags [2/5] ◆ m_Flags [3/5] ◆ m_Flags [4/5] TFlags CRequestContextGuard_Base::m_Flags = 0 private ◆ m_Flags [5/5] ◆ m_Flushed bool CDiagContext_Extra::m_Flushed private ◆ m_Format ◆ m_Function [1/2] ◆ m_Function [2/2] const char* SDiagMessage::m_Function ◆ m_FunctName string CDiagCompileInfo::m_FunctName mutableprivate ◆ m_Handle ◆ m_HandleLock CSpinLock* CFileHandleDiagHandler::m_HandleLock private ◆ m_Handler ◆ m_HavePosts bool CFileHandleDiagHandler::m_HavePosts private ◆ m_HitId ◆ m_HitID ◆ m_HitIDLoggedFlag int CRequestContext::m_HitIDLoggedFlag mutableprivate ◆ m_Host ◆ m_HostIP ◆ m_Ident ◆ m_IgnoreToDie bool CDiagRestorer::m_IgnoreToDie private ◆ m_Info TInfo CDiagErrCodeInfo::m_Info private ◆ 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 ◆ m_Line [1/2] int CDiagCompileInfo::m_Line private ◆ m_Line [2/2] size_t SDiagMessage::m_Line ◆ m_Log ◆ m_LoggedHitId bool CDiagContext::m_LoggedHitId mutableprivate ◆ m_Logger ◆ m_LogName char CStreamDiagHandler_Base::m_LogName[2048] private ◆ m_LowDiskSpace bool CFileHandleDiagHandler::m_LowDiskSpace private ◆ m_MaxMessages size_t CDiagContext::m_MaxMessages private ◆ m_Message string SDiagErrCodeDescription::m_Message ◆ m_Messages [1/2] unique_ptr<TMessages> CDiagContext::m_Messages private ◆ m_Messages [2/2] unique_ptr<TMessages> CFileHandleDiagHandler::m_Messages private ◆ m_Module [1/3] const char* CDiagCompileInfo::m_Module private ◆ m_Module [2/3] ◆ m_Module [3/3] const char* SDiagMessage::m_Module ◆ m_NoTee bool SDiagMessage::m_NoTee ◆ 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 ◆ m_OwnLog bool CFileDiagHandler::m_OwnLog private ◆ m_OwnPerf bool CFileDiagHandler::m_OwnPerf private ◆ m_OwnTrace bool CFileDiagHandler::m_OwnTrace private ◆ m_Parameters ◆ m_Parsed bool CDiagCompileInfo::m_Parsed mutableprivate ◆ m_PassThroughProperties ◆ m_Perf ◆ m_PerfStatus int CDiagContext_Extra::m_PerfStatus private ◆ m_PerfTime double CDiagContext_Extra::m_PerfTime private ◆ m_PID ◆ m_PostFlags [1/2] ◆ m_PostFlags [2/2] ◆ m_PostPrefix string CDiagRestorer::m_PostPrefix private ◆ m_PostSeverity ◆ m_PostSeverityChange ◆ m_Prefix const char* SDiagMessage::m_Prefix ◆ m_PrefixList list<string> CDiagRestorer::m_PrefixList private ◆ m_PrintSev ◆ m_PrintStackTrace bool SDiagMessage::m_PrintStackTrace ◆ m_ProcPost TCount SDiagMessage::m_ProcPost ◆ m_Properties [1/2] ◆ m_Properties [2/2] ◆ m_PropSet ◆ m_QuickFlush bool CStreamDiagHandler::m_QuickFlush private ◆ m_ReopenTimer [1/2] ◆ m_ReopenTimer [2/2] ◆ m_ReqStatus int CRequestContext::m_ReqStatus private ◆ m_ReqTimer ◆ m_RequestContext ◆ m_RequestId TCount SDiagMessage::m_RequestId ◆ m_RequestID TCount CRequestContext::m_RequestID private ◆ m_Resource string CPerfLogGuard::m_Resource private ◆ m_SavedContext ◆ m_SessionID ◆ m_Severity [1/3] ◆ m_Severity [2/3]Severity level.
Definition at line 1651 of file ncbidiag.hpp.
Referenced by DisplayDiagnostic(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CBlastAppDiagHandler::Post(), CAsyncDiagHandler::Post(), CSysLog::Post(), CTeeDiagHandler::Post(), CTable2AsnLogger::Post(), CPythonDiagHandler::Post(), COpentelemetryTracerSpan::PostEvent(), CDiagHandler::PostToConsole(), SDiagMessage::SDiagMessage(), ncbi::CNcbiToolkit_LogMessage::Severity(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
◆ m_Severity [3/3] int SDiagErrCodeDescription::m_Severity ◆ m_SeverityCap EDiagSev CDiagCollectGuard::m_SeverityCap private ◆ m_SharedSubHitId ◆ m_Source string CNcbiLogFields::m_Source private ◆ m_Span [1/2] shared_ptr<jaegertracing::Span> CJaegerTracerSpan::m_Span private ◆ m_Span [2/2] TSpan COpentelemetryTracerSpan::m_Span private ◆ m_SpanKind [1/2] opentelemetry::trace::SpanKind COpentelemetryTracer::m_SpanKind = opentelemetry::trace::SpanKind::kInternal private ◆ m_SpanKind [2/2] ◆ m_StartingPoint Uint8 CDiagCollectGuard::m_StartingPoint private ◆ m_StopWatch [1/2] ◆ m_StopWatch [2/2] ◆ m_StrCurrFunctName string CDiagCompileInfo::m_StrCurrFunctName private ◆ m_Stream ◆ m_StrFile string CDiagCompileInfo::m_StrFile private ◆ m_StrModule string CDiagCompileInfo::m_StrModule private ◆ m_SubCode ◆ m_SubHitId ◆ m_SubHitIDCache string CRequestContext::m_SubHitIDCache private ◆ m_ThreadSuffix string CAsyncDiagHandler::m_ThreadSuffix private ◆ m_ThrPost TCount SDiagMessage::m_ThrPost ◆ m_TID ◆ m_TimerState ◆ m_Trace ◆ m_TraceDefault ◆ m_TraceEnabled bool CDiagRestorer::m_TraceEnabled private ◆ m_TraceLogRC ◆ m_TraceLogSuspended atomic<bool> CDiagContext::m_TraceLogSuspended private ◆ m_TraceParent [1/2] ◆ m_TraceParent [2/2] string CRequestContext::m_TraceParent private ◆ m_Tracer [1/2] ◆ m_Tracer [2/2] ◆ m_TracerSpan ◆ m_TraceState [1/2] ◆ m_TraceState [2/2] string CRequestContext::m_TraceState private ◆ m_Typed bool CDiagContext_Extra::m_Typed private ◆ m_TypedExtra bool SDiagMessage::m_TypedExtra ◆ m_UID ◆ m_Username ◆ m_Version ◆ sm_ApplogSeverityLocked bool CDiagContext::sm_ApplogSeverityLocked = false staticprivate ◆ sm_ContextFields ◆ sm_Current ◆ sm_EnvContextProperties ◆ sm_Instance ◆ sm_PID ◆ sm_Tracer ◆ sm_VersionCounter ◆ value const char* SNcbiLog_Param::value ◆ CDiagBuffer [1/2] ◆ CDiagBuffer [2/2] ◆ CDiagContext [1/3] ◆ CDiagContext [2/3] ◆ CDiagContext [3/3] ◆ CDiagContext_Extra [1/2] ◆ CDiagContext_Extra [2/2] ◆ CDiagContextThreadData [1/2] ◆ CDiagContextThreadData [2/2] ◆ CNcbiDiag ◆ ConsoleSet 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().
◆ COpentelemetryTracer ◆ CPerfLogGuard ◆ CRequestContext ◆ CRequestContext_PassThrough ◆ CriticalFlush current message, then set a severity for the next diagnostic message to CRITICAL ERROR.
◆ Endm ◆ ErrorFlush current message, then set a severity for the next diagnostic message to ERROR.
◆ FatalFlush current message, then set a severity for the next diagnostic message to FATAL.
◆ g_PostPerf ◆ InfoFlush current message, then set a severity for the next diagnostic message to INFO.
◆ MessageSet 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().
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] ◆ operator<< [2/3] ◆ operator<< [3/3] ◆ ResetReset the content of current message.
◆ StackTrace ◆ TraceFlush current message, then set a severity for the next diagnostic message to TRACE.
◆ WarningFlush current message, then set a severity for the next diagnostic message to WARNING.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4