NCBI C++ ToolKit
|
Classes | |
class | CJaegerTracerSpan |
class | CJaegerTracer |
IRequestTracer implementation for Jaeger tracing. More... | |
class | CDiagCompileInfo |
Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function. More... | |
struct | WRONG_ERROR_SUBCODE_IN_POST_MACRO< errorCode, errorSubcode, maxErrorSubcode, isWrong > |
Template structure used to point out wrong error subcode in ERR_POST_X, STD_CATCH_X and alike macros. More... | |
struct | WRONG_ERROR_SUBCODE_IN_POST_MACRO< errorCode, errorSubcode, maxErrorSubcode, false > |
Specialization of template: when error subcode is valid existence of this specialization will be valuable for not issuing compiler error. More... | |
struct | WRONG_USAGE_OF_DEFINE_ERR_SUBCODE_MACRO< errorCode, isWrong > |
Template structure used to point out incorrect usage of NCBI_DEFINE_ERR_SUBCODE_X macro i.e. More... | |
struct | WRONG_USAGE_OF_DEFINE_ERR_SUBCODE_MACRO< errorCode, false > |
Specialization of template: when usage of NCBI_DEFINE_ERR_SUBCODE_X is correct existence of this specialization will be valuable for not issuing compiler error. More... | |
class | ErrCode |
ErrCode –. More... | |
class | Severity |
Severity –. More... | |
class | SetPostFlags |
SetPostFlags –. More... | |
class | MDiagModule |
MDiagModule –. More... | |
class | MDiagClass |
MDiagClass –. More... | |
class | MDiagFunction |
MDiagFunction –. More... | |
class | CNcbiDiag |
CNcbiDiag –. More... | |
class | CDiagCollectGuard |
Guard for collecting diag messages (affects the current thread only). More... | |
class | CDiagAutoPrefix |
CDiagAutoPrefix –. More... | |
class | INextDiagMessage |
Callback interface for stream parser. More... | |
struct | SDiagMessage |
SDiagMessage –. More... | |
class | CStrictId< TKey, TStorage > |
Template class for strict ID types. More... | |
class | CDiagContext_Extra |
Temporary object for holding extra message arguments. More... | |
class | CDiagContext |
class | CNcbiLogFields |
CNcbiLogFields –. More... | |
class | CDiagHandler |
class | CStreamDiagHandler_Base |
CStreamDiagHandler_Base –. More... | |
class | CStreamDiagHandler |
CStreamDiagHandler –. More... | |
class | CFileHandleDiagHandler |
CFileHandleDiagHandler –. More... | |
class | CFileDiagHandler |
CFileDiagHandler –. More... | |
class | CAsyncDiagHandler |
class | CDiagFactory |
CDiagFactory –. More... | |
class | CDiagRestorer |
CDiagRestorer –. More... | |
struct | SDiagErrCodeDescription |
SDiagErrCodeDescription –. More... | |
class | CDiagErrCodeInfo |
CDiagErrCodeInfo –. More... | |
class | CPerfLogger |
CPerfLogger –. More... | |
class | CPerfLogGuard |
CPerfLogGuard –. More... | |
class | CSharedHitId |
Helper class to hold hit id and sub-hit counter which can be shared between multiple request contexts. More... | |
class | IRequestTracer |
class | ITracerSpan |
class | CRequestContext |
class | CRequestContext_PassThrough |
Request context properties passed between tasks. More... | |
class | CRequestContextGuard_Base |
Take guard of the current CRequestContext, handle app-state, start/stop logging and request status in the dtor. More... | |
class | CRequestContextException |
class | CRequestStatus |
class | CSysLog |
struct | SNcbiLog_Param |
Structure to describe pairs 'key=value', used to posting parameters. More... | |
Macros | |
#define | NCBI_CURRENT_FUNCTION NCBI_NS_NCBI::g_DiagUnknownFunction() |
Get current function name. More... | |
#define | NCBI_MAKE_MODULE(module) NCBI_AS_STRING(module) |
Set default module name based on NCBI_MODULE macro. More... | |
#define | DIAG_COMPILE_INFO |
Make compile time diagnostic information object to use in CNcbiDiag and CException. More... | |
#define | ERR_POST(message) |
Error posting with file, line number information but without error codes. More... | |
#define | SEVERITY_POST(severity, message) |
Wrappers for ERR_POST family of macros checking if the desired severity is enabled. More... | |
#define | WARNING_POST(message) SEVERITY_POST(Warning, message) |
#define | INFO_POST(message) SEVERITY_POST(Info, message) |
#define | TRACE_POST(message) SEVERITY_POST(Trace, message) |
#define | SEVERITY_POST_X(severity, subcode, message) |
#define | WARNING_POST_X(subcode, message) SEVERITY_POST_X(Warning, subcode, message) |
#define | INFO_POST_X(subcode, message) SEVERITY_POST_X(Info, subcode, message) |
#define | TRACE_POST_X(subcode, message) SEVERITY_POST_X(Trace, subcode, message) |
#define | SEVERITY_POST_EX(severity, errcode, subcode, message) |
#define | WARNING_POST_EX(errcode, subcode, message) SEVERITY_POST_EX(Warning, errcode, subcode, message) |
#define | INFO_POST_EX(errcode, message) SEVERITY_POST_EX(Info, errcode, subcode, message) |
#define | TRACE_POST_EX(errcode, message) SEVERITY_POST_EX(Trace, errcode, subcode, message) |
#define | LOG_POST(message) |
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro LOG_POST_X to make possible more flexible error statistics and logging. More... | |
#define | ERR_FATAL(message) |
Posting fatal error and abort. More... | |
#define | ERR_POST_EX(err_code, err_subcode, message) |
Error posting with error codes. More... | |
#define | LOG_POST_EX(err_code, err_subcode, message) |
#define | ERR_FATAL_EX(err_code, err_subcode, message) |
#define | NCBI_DEFINE_ERRCODE_X(name, err_code, max_err_subcode) |
Define global error code name with given value (err_code) and given maximum value of error subcode within this code. More... | |
#define | NCBI_DEFINE_ERR_SUBCODE_X(max_err_subcode) NCBI_DEFINE_ERR_SUBCODE_XX(NCBI_USE_ERRCODE_X, max_err_subcode) |
Define maximum value of subcode for the error code currently in use. More... | |
#define | NCBI_DEFINE_ERR_SUBCODE_XX(name, max_err_subcode) |
Define maximum value of subcode for particular error code name. More... | |
#define | NCBI_ERRCODE_X_NAME(name) NCBI_NS_NCBI::err_code_x::NCBI_NAME2(eErrCodeX_, name) |
Returns value of error code by its name defined by NCBI_DEFINE_ERRCODE_X. More... | |
#define | NCBI_ERRCODE_X NCBI_ERRCODE_X_NAME(NCBI_USE_ERRCODE_X) |
Returns currently set default error code. More... | |
#define | NCBI_MAX_ERR_SUBCODE_X_NAME(name) NCBI_NS_NCBI::err_code_x::NCBI_NAME2(SErrCodeX_Max_, name)<true>::value |
Returns maximum value of error subcode within error code with given name. More... | |
#define | NCBI_MAX_ERR_SUBCODE_X NCBI_MAX_ERR_SUBCODE_X_NAME(NCBI_USE_ERRCODE_X) |
Returns maximum value of error subcode within current default error code. More... | |
#define | NCBI_CHECK_ERRCODE_USAGE(name) |
Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code. More... | |
#define | NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode) |
Issue compile-time error if error subcode given is not valid for given error code name. More... | |
#define | NCBI_CHECK_ERR_SUBCODE_X(subcode) NCBI_CHECK_ERR_SUBCODE_X_NAME(NCBI_USE_ERRCODE_X, subcode) |
Issue compile-time error if error subcode given is not valid for current error code. More... | |
#define | NCBI_ERR_SUBCODE_X_NAME(name, subcode) (NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode), subcode) |
Pass subcode as argument with check of its validity for given error code. More... | |
#define | NCBI_ERR_SUBCODE_X(subcode) (NCBI_CHECK_ERR_SUBCODE_X(subcode), subcode) |
Pass subcode as argument with check of its validity for current error code. More... | |
#define | ERR_POST_X(err_subcode, message) ERR_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
Error posting with default error code and given error subcode. More... | |
#define | LOG_POST_X(err_subcode, message) LOG_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
#define | ERR_FATAL_X(err_subcode, message) ERR_FATAL_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
#define | ERR_POST_XX(error_name, err_subcode, message) |
Error posting with error code having given name and with given error subcode. More... | |
#define | LOG_POST_XX(error_name, err_subcode, message) |
#define | ERR_FATAL_XX(error_name, err_subcode, message) |
#define | NCBI_REPEAT_POST_N_TIMES(post_macro, count, params) |
Common code for making log or error posting only given number of times during program execution. More... | |
#define | ERR_POST_N_TIMES(count, message) NCBI_REPEAT_POST_N_TIMES( ERR_POST, count, (message) ) |
Error posting only given number of times during program execution. More... | |
#define | LOG_POST_N_TIMES(count, message) NCBI_REPEAT_POST_N_TIMES( LOG_POST, count, (message) ) |
#define | ERR_POST_ONCE(message) ERR_POST_N_TIMES(1, message) |
Error posting only once during program execution. More... | |
#define | LOG_POST_ONCE(message) LOG_POST_N_TIMES(1, message) |
#define | ERR_POST_X_N_TIMES(count, err_subcode, message) NCBI_REPEAT_POST_N_TIMES( ERR_POST_X, count, (err_subcode, message) ) |
Error posting only given number of times during program execution with default error code and given error subcode. More... | |
#define | LOG_POST_X_N_TIMES(count, err_subcode, message) NCBI_REPEAT_POST_N_TIMES( LOG_POST_X, count, (err_subcode, message) ) |
#define | ERR_POST_X_ONCE(err_subcode, message) ERR_POST_X_N_TIMES(1, err_subcode, message) |
Error posting only once during program execution with default error code and given error subcode. More... | |
#define | LOG_POST_X_ONCE(err_subcode, message) LOG_POST_X_N_TIMES(1, err_subcode, message) |
#define | ERR_POST_XX_N_TIMES(count, error_name, err_subcode, message) |
Error posting only given number of times during program execution with given error code name and given error subcode. More... | |
#define | LOG_POST_XX_N_TIMES(count, error_name, err_subcode, message) |
#define | ERR_POST_XX_ONCE(error_name, err_subcode, message) ERR_POST_XX_N_TIMES(1, error_name, err_subcode, message) |
Error posting only once during program execution with given error code name and given error subcode. More... | |
#define | LOG_POST_XX_ONCE(error_name, err_subcode, message) LOG_POST_XX_N_TIMES(1, error_name, err_subcode, message) |
#define | DIAG_POST_LEVEL "DIAG_POST_LEVEL" |
Diagnostic post severity level. More... | |
#define | DIAG_TRACE "DIAG_TRACE" |
Diagnostic trace setting. More... | |
#define | DIAG_MESSAGE_FILE "MessageFile" |
Diagnostic message file. More... | |
#define | PERF_POST(perf_logger, status, resource, args) |
Convenience macro that also saves cycles when the performance logging is globally turned off. More... | |
#define | PERF_POST_DB(perf_logger, status, resource, server, args) |
Adaptation for logging database performance. More... | |
#define | __STDC_FORMAT_MACROS |
#define | NCBILOG_INT8_FORMAT_SPEC "I64" |
#define | NCBILOG_UINT8_FORMAT_SPEC "I64u" |
#define __STDC_FORMAT_MACROS |
Definition at line 120 of file ncbi_c_log.h.
#define DIAG_COMPILE_INFO |
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.
#define DIAG_MESSAGE_FILE "MessageFile" |
Diagnostic message file.
Definition at line 3092 of file ncbidiag.hpp.
#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.
#define DIAG_TRACE "DIAG_TRACE" |
Diagnostic trace setting.
Definition at line 1540 of file ncbidiag.hpp.
#define ERR_FATAL | ( | message | ) |
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.
#define ERR_FATAL_EX | ( | err_code, | |
err_subcode, | |||
message | |||
) |
Definition at line 266 of file ncbidiag.hpp.
#define ERR_FATAL_X | ( | err_subcode, | |
message | |||
) | ERR_FATAL_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
Definition at line 556 of file ncbidiag.hpp.
#define ERR_FATAL_XX | ( | error_name, | |
err_subcode, | |||
message | |||
) |
Definition at line 574 of file ncbidiag.hpp.
#define ERR_POST | ( | message | ) |
Error posting with file, line number information but without error codes.
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro ERR_POST_X to make possible more flexible error statistics and logging.
Definition at line 186 of file ncbidiag.hpp.
#define ERR_POST_EX | ( | err_code, | |
err_subcode, | |||
message | |||
) |
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.
#define ERR_POST_N_TIMES | ( | count, | |
message | |||
) | NCBI_REPEAT_POST_N_TIMES( ERR_POST, count, (message) ) |
Error posting only given number of times during program execution.
Definition at line 594 of file ncbidiag.hpp.
#define ERR_POST_ONCE | ( | message | ) | ERR_POST_N_TIMES(1, message) |
Error posting only once during program execution.
Definition at line 602 of file ncbidiag.hpp.
#define ERR_POST_X | ( | err_subcode, | |
message | |||
) | ERR_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
Error posting with default error code and given error subcode.
Also checks subcode correctness. When error subcode is incorrect (greater than defined in NCBI_DEFINE_ERRCODE_X) compile-time error is issued. All calls to ERR_POST_X under the same default error code MUST be with deferent error subcodes to make possible more flexible error statistics and logging. If using the macro leads to compile errors containing strings like "err_code_x" or "ErrCodeX" in messages, it means you didn't define error code name with NCBI_DEFINE_ERRCODE_X macro or didn't select current default error code with valid NCBI_USE_ERRCODE_X definition. This macro allows the use of only constant error subcodes (integer literals or enum constants). If you need to make variable error subcode you need to use macro ERR_POST_EX as follows:
NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 5); ... #define NCBI_USE_ERRCODE_X Corelib_Util ... ERR_POST_EX(NCBI_ERRCODE_X, my_subcode, "My error message with variables " << var);
Or in more complicated way:
NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 5); ... // no need to define NCBI_USE_ERRCODE_X ... ERR_POST_EX(NCBI_ERRCODE_X_NAME(Corelib_Util), my_subcode, "My error message with variables " << var);
It's strongly recommended to use macro NCBI_CHECK_ERR_SUBCODE_X (or NCBI_CHECK_ERR_SUBCODE_X_NAME in complicated case) to check validity of error subcodes in places where variable 'my_subcode' is assigned.
Definition at line 550 of file ncbidiag.hpp.
#define ERR_POST_X_N_TIMES | ( | count, | |
err_subcode, | |||
message | |||
) | NCBI_REPEAT_POST_N_TIMES( ERR_POST_X, count, (err_subcode, message) ) |
Error posting only given number of times during program execution with default error code and given error subcode.
Definition at line 611 of file ncbidiag.hpp.
#define ERR_POST_X_ONCE | ( | err_subcode, | |
message | |||
) | ERR_POST_X_N_TIMES(1, err_subcode, message) |
Error posting only once during program execution with default error code and given error subcode.
Definition at line 621 of file ncbidiag.hpp.
#define ERR_POST_XX | ( | error_name, | |
err_subcode, | |||
message | |||
) |
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.
#define ERR_POST_XX_N_TIMES | ( | count, | |
error_name, | |||
err_subcode, | |||
message | |||
) |
Error posting only given number of times during program execution with given error code name and given error subcode.
Definition at line 631 of file ncbidiag.hpp.
#define ERR_POST_XX_ONCE | ( | error_name, | |
err_subcode, | |||
message | |||
) | ERR_POST_XX_N_TIMES(1, error_name, err_subcode, message) |
Error posting only once during program execution with given error code name and given error subcode.
Definition at line 643 of file ncbidiag.hpp.
#define INFO_POST | ( | message | ) | SEVERITY_POST(Info, message) |
Definition at line 201 of file ncbidiag.hpp.
#define INFO_POST_EX | ( | errcode, | |
message | |||
) | SEVERITY_POST_EX(Info, errcode, subcode, message) |
Definition at line 215 of file ncbidiag.hpp.
#define INFO_POST_X | ( | subcode, | |
message | |||
) | SEVERITY_POST_X(Info, subcode, message) |
Definition at line 208 of file ncbidiag.hpp.
#define LOG_POST | ( | message | ) |
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro LOG_POST_X to make possible more flexible error statistics and logging.
Definition at line 226 of file ncbidiag.hpp.
#define LOG_POST_EX | ( | err_code, | |
err_subcode, | |||
message | |||
) |
Definition at line 258 of file ncbidiag.hpp.
#define LOG_POST_N_TIMES | ( | count, | |
message | |||
) | NCBI_REPEAT_POST_N_TIMES( LOG_POST, count, (message) ) |
Definition at line 597 of file ncbidiag.hpp.
#define LOG_POST_ONCE | ( | message | ) | LOG_POST_N_TIMES(1, message) |
Definition at line 604 of file ncbidiag.hpp.
#define LOG_POST_X | ( | err_subcode, | |
message | |||
) | LOG_POST_XX(NCBI_USE_ERRCODE_X, err_subcode, message) |
Definition at line 553 of file ncbidiag.hpp.
#define LOG_POST_X_N_TIMES | ( | count, | |
err_subcode, | |||
message | |||
) | NCBI_REPEAT_POST_N_TIMES( LOG_POST_X, count, (err_subcode, message) ) |
Definition at line 614 of file ncbidiag.hpp.
#define LOG_POST_X_ONCE | ( | err_subcode, | |
message | |||
) | LOG_POST_X_N_TIMES(1, err_subcode, message) |
Definition at line 624 of file ncbidiag.hpp.
#define LOG_POST_XX | ( | error_name, | |
err_subcode, | |||
message | |||
) |
Definition at line 569 of file ncbidiag.hpp.
#define LOG_POST_XX_N_TIMES | ( | count, | |
error_name, | |||
err_subcode, | |||
message | |||
) |
Definition at line 635 of file ncbidiag.hpp.
#define LOG_POST_XX_ONCE | ( | error_name, | |
err_subcode, | |||
message | |||
) | LOG_POST_XX_N_TIMES(1, error_name, err_subcode, message) |
Definition at line 646 of file ncbidiag.hpp.
#define NCBI_CHECK_ERR_SUBCODE_X | ( | subcode | ) | NCBI_CHECK_ERR_SUBCODE_X_NAME(NCBI_USE_ERRCODE_X, subcode) |
Issue compile-time error if error subcode given is not valid for current error code.
Definition at line 464 of file ncbidiag.hpp.
#define NCBI_CHECK_ERR_SUBCODE_X_NAME | ( | name, | |
subcode | |||
) |
Issue compile-time error if error subcode given is not valid for given error code name.
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.
#define NCBI_CHECK_ERRCODE_USAGE | ( | name | ) |
Check that NCBI_DEFINE_ERR_SUBCODE_X is used for correctly defined error code.
Definition at line 432 of file ncbidiag.hpp.
#define NCBI_CURRENT_FUNCTION NCBI_NS_NCBI::g_DiagUnknownFunction() |
Get current function name.
Defined inside of either a method or a function body only.
Definition at line 142 of file ncbidiag.hpp.
#define NCBI_DEFINE_ERR_SUBCODE_X | ( | max_err_subcode | ) | NCBI_DEFINE_ERR_SUBCODE_XX(NCBI_USE_ERRCODE_X, max_err_subcode) |
Define maximum value of subcode for the error code currently in use.
Currently used error code is defined by macro NCBI_USE_ERRCODE_X. This macro is a simplified version of NCBI_DEFINE_ERR_SUBCODE_XX and can be handy to use when some error code is used only in one source file and no other error code is used in the same source file. To use this macro you must put 0 as max_err_subcode in NCBI_DEFINE_ERRCODE_X macro. Otherwise compilation error will occur. Macro MUST be used inside ncbi scope.
Example: NCBI_DEFINE_ERRCODE_X(Corelib_Util, 110, 0); ... #define NCBI_USE_ERRCODE_X Corelib_Util NCBI_DEFINE_ERR_SUBCODE_X(5); ... ERR_POST_X(3, "My error message with variables " << var);
Definition at line 333 of file ncbidiag.hpp.
#define NCBI_DEFINE_ERR_SUBCODE_XX | ( | name, | |
max_err_subcode | |||
) |
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.
#define NCBI_DEFINE_ERRCODE_X | ( | name, | |
err_code, | |||
max_err_subcode | |||
) |
Define global error code name with given value (err_code) and given maximum value of error subcode within this code.
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.
#define NCBI_ERR_SUBCODE_X | ( | subcode | ) | (NCBI_CHECK_ERR_SUBCODE_X(subcode), subcode) |
Pass subcode as argument with check of its validity for current error code.
Definition at line 472 of file ncbidiag.hpp.
#define NCBI_ERR_SUBCODE_X_NAME | ( | name, | |
subcode | |||
) | (NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode), subcode) |
Pass subcode as argument with check of its validity for given error code.
Definition at line 468 of file ncbidiag.hpp.
#define NCBI_ERRCODE_X NCBI_ERRCODE_X_NAME(NCBI_USE_ERRCODE_X) |
Returns currently set default error code.
Default error code is set by definition of NCBI_USE_ERRCODE_X with name of error code as its value.
Definition at line 376 of file ncbidiag.hpp.
#define NCBI_ERRCODE_X_NAME | ( | name | ) | NCBI_NS_NCBI::err_code_x::NCBI_NAME2(eErrCodeX_, name) |
Returns value of error code by its name defined by NCBI_DEFINE_ERRCODE_X.
Definition at line 369 of file ncbidiag.hpp.
#define NCBI_MAKE_MODULE | ( | module | ) | NCBI_AS_STRING(module) |
Set default module name based on NCBI_MODULE macro.
Definition at line 149 of file ncbidiag.hpp.
#define NCBI_MAX_ERR_SUBCODE_X NCBI_MAX_ERR_SUBCODE_X_NAME(NCBI_USE_ERRCODE_X) |
Returns maximum value of error subcode within current default error code.
Definition at line 387 of file ncbidiag.hpp.
#define NCBI_MAX_ERR_SUBCODE_X_NAME | ( | name | ) | NCBI_NS_NCBI::err_code_x::NCBI_NAME2(SErrCodeX_Max_, name)<true>::value |
Returns maximum value of error subcode within error code with given name.
Definition at line 381 of file ncbidiag.hpp.
#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.
This macro MUST not be used outside this header.
Definition at line 582 of file ncbidiag.hpp.
#define NCBILOG_INT8_FORMAT_SPEC "I64" |
Definition at line 291 of file ncbi_c_log.h.
#define NCBILOG_UINT8_FORMAT_SPEC "I64u" |
Definition at line 292 of file ncbi_c_log.h.
#define PERF_POST | ( | perf_logger, | |
status, | |||
resource, | |||
args | |||
) |
Convenience macro that also saves cycles when the performance logging is globally turned off.
Definition at line 213 of file perf_log.hpp.
#define PERF_POST_DB | ( | perf_logger, | |
status, | |||
resource, | |||
server, | |||
args | |||
) |
Adaptation for logging database performance.
Definition at line 232 of file perf_log.hpp.
#define SEVERITY_POST | ( | severity, | |
message | |||
) |
Wrappers for ERR_POST family of macros checking if the desired severity is enabled.
Definition at line 196 of file ncbidiag.hpp.
#define SEVERITY_POST_EX | ( | severity, | |
errcode, | |||
subcode, | |||
message | |||
) |
Definition at line 210 of file ncbidiag.hpp.
#define SEVERITY_POST_X | ( | severity, | |
subcode, | |||
message | |||
) |
Definition at line 203 of file ncbidiag.hpp.
#define TRACE_POST | ( | message | ) | SEVERITY_POST(Trace, message) |
Definition at line 202 of file ncbidiag.hpp.
#define TRACE_POST_EX | ( | errcode, | |
message | |||
) | SEVERITY_POST_EX(Trace, errcode, subcode, message) |
Definition at line 216 of file ncbidiag.hpp.
#define TRACE_POST_X | ( | subcode, | |
message | |||
) | SEVERITY_POST_X(Trace, subcode, message) |
Definition at line 209 of file ncbidiag.hpp.
#define WARNING_POST | ( | message | ) | SEVERITY_POST(Warning, message) |
Definition at line 200 of file ncbidiag.hpp.
#define WARNING_POST_EX | ( | errcode, | |
subcode, | |||
message | |||
) | SEVERITY_POST_EX(Warning, errcode, subcode, message) |
Definition at line 214 of file ncbidiag.hpp.
#define WARNING_POST_X | ( | subcode, | |
message | |||
) | SEVERITY_POST_X(Warning, subcode, message) |
Definition at line 207 of file ncbidiag.hpp.
typedef CSysLog CSysLogDiagHandler |
Definition at line 126 of file syslog.hpp.
typedef void(* FAbortHandler) (void) |
Abort handler function type.
Definition at line 1524 of file ncbidiag.hpp.
typedef void(* FDiagCleanup) (void *data) |
Diagnostic cleanup function type.
Definition at line 2488 of file ncbidiag.hpp.
typedef void(* FDiagHandler) (const SDiagMessage &mess) |
Diagnostic handler function type.
Definition at line 2485 of file ncbidiag.hpp.
typedef IOS_BASE&(* CNcbiDiag::FIosbaseManip) (IOS_BASE &) |
Definition at line 955 of file ncbidiag.hpp.
Definition at line 956 of file ncbidiag.hpp.
Diagnostic stream manipulator.
Definition at line 954 of file ncbidiag.hpp.
typedef int(* FNcbiLog_MTLock_Handler) (void *user_data, ENcbiLog_MTLock_Action action) |
MT locking callback.
user_data | Unspecified data to call "handler" with. Could be used to have the same handler for some different MT locks. The 'user_data' allow to distinguish each lock and adjust behavior accordingly. |
action | Operation that should be done in the callback handler. |
Definition at line 186 of file ncbi_c_log.h.
typedef int CRequestContext::TContextFlags |
Definition at line 166 of file request_ctx.hpp.
typedef Uint8 SDiagMessage::TCount |
Generic type for counters (posts, requests etc.)
Definition at line 1605 of file ncbidiag.hpp.
Definition at line 2265 of file ncbidiag.hpp.
Definition at line 171 of file request_ctx.hpp.
typedef int TDiagPostFlags |
Binary OR of "EDiagPostFlag".
Definition at line 785 of file ncbidiag.hpp.
typedef int TDiagUserAndHost |
Definition at line 56 of file ncbi_userhost.hpp.
typedef int SDiagMessage::TDiagWriteFlags |
Definition at line 1708 of file ncbidiag.hpp.
typedef pair<string, string> SDiagMessage::TExtraArg |
Definition at line 1674 of file ncbidiag.hpp.
Definition at line 1863 of file ncbidiag.hpp.
typedef list<TExtraArg> SDiagMessage::TExtraArgs |
Definition at line 1675 of file ncbidiag.hpp.
Definition at line 1864 of file ncbidiag.hpp.
|
private |
Definition at line 2420 of file ncbidiag.hpp.
typedef int CRequestContextGuard_Base::TFlags |
Definition at line 577 of file request_ctx.hpp.
typedef int CSysLog::TFlags |
Definition at line 61 of file syslog.hpp.
|
private |
Define map for error messages.
Definition at line 3083 of file ncbidiag.hpp.
|
private |
Definition at line 2349 of file ncbidiag.hpp.
|
private |
Save messages if the handle is unavailable.
Definition at line 2682 of file ncbidiag.hpp.
typedef struct SNcbiLog_Context_tag* TNcbiLog_Context |
Definition at line 311 of file ncbi_c_log.h.
typedef TNcbiLog_UInt8 TNcbiLog_Counter |
Definition at line 305 of file ncbi_c_log.h.
typedef __int64 TNcbiLog_Int8 |
Big integer type.
Definition at line 289 of file ncbi_c_log.h.
typedef struct TNcbiLog_MTLock_tag* TNcbiLog_MTLock |
Definition at line 147 of file ncbi_c_log.h.
typedef int TNcbiLog_OnForkFlags |
Binary OR of "ENcbiLog_OnForkAction".
Definition at line 455 of file ncbi_c_log.h.
typedef TNcbiLog_UInt8 TNcbiLog_PID |
Process, thread and counter types.
Definition at line 303 of file ncbi_c_log.h.
typedef TNcbiLog_UInt8 TNcbiLog_TID |
Definition at line 304 of file ncbi_c_log.h.
typedef unsigned __int64 TNcbiLog_UInt8 |
Definition at line 290 of file ncbi_c_log.h.
typedef int CDiagContext::TOnForkFlags |
Definition at line 1952 of file ncbidiag.hpp.
Definition at line 2636 of file ncbidiag.hpp.
Definition at line 2700 of file ncbidiag.hpp.
|
private |
Definition at line 492 of file request_ctx.hpp.
typedef Uint8 SDiagMessage::TPID |
Process ID.
Definition at line 1600 of file ncbidiag.hpp.
typedef Uint8 CDiagContext::TPID |
Definition at line 1936 of file ncbidiag.hpp.
|
private |
Definition at line 2319 of file ncbidiag.hpp.
typedef map<string, string> CRequestContext::TProperties |
User-defined request properties.
Definition at line 287 of file request_ctx.hpp.
Definition at line 560 of file request_ctx.hpp.
|
private |
Definition at line 418 of file request_ctx.hpp.
typedef int CDiagHandler::TReopenFlags |
Definition at line 2477 of file ncbidiag.hpp.
|
private |
Definition at line 129 of file request_ctx.hpp.
typedef unsigned int CSharedHitId::TSubHitId |
Definition at line 102 of file request_ctx.hpp.
typedef Uint8 SDiagMessage::TTID |
Thread ID.
Definition at line 1601 of file ncbidiag.hpp.
typedef Uint8 CDiagContext::TTID |
Get thread ID used in messages.
Definition at line 2272 of file ncbidiag.hpp.
typedef Int8 SDiagMessage::TUID |
Unique process ID.
Definition at line 1602 of file ncbidiag.hpp.
typedef SDiagMessage::TUID CDiagContext::TUID |
Definition at line 1975 of file ncbidiag.hpp.
Definition at line 376 of file request_ctx.hpp.
anonymous enum |
Enumerator | |
---|---|
valid |
Definition at line 410 of file ncbidiag.hpp.
anonymous enum |
Enumerator | |
---|---|
valid |
Definition at line 427 of file ncbidiag.hpp.
Action to perform in guard's destructor.
Enumerator | |
---|---|
ePrint | Print all collected messages as is. |
eDiscard | Discard collected messages, default. |
ePrintCapped | Print collected messages at reduced severity. |
Definition at line 1303 of file ncbidiag.hpp.
enum EAppDiagStream |
Where to write the application's diagnostics to.
Definition at line 1780 of file ncbidiag.hpp.
Definition at line 57 of file request_status.hpp.
Request context flags.
Enumerator | |
---|---|
fResetOnStart | Reset values when printing request-start. |
fDefault |
Definition at line 161 of file request_ctx.hpp.
|
private |
Enumerator | |
---|---|
eHitID_NoCreate | |
eHitID_Create |
Definition at line 2335 of file ncbidiag.hpp.
enum EDiagAppState |
Application execution states shown in the std prefix.
Enumerator | |
---|---|
eDiagAppState_NotSet | Reserved value, never used in messages. |
eDiagAppState_AppBegin | AB. |
eDiagAppState_AppRun | A. |
eDiagAppState_AppEnd | AE. |
eDiagAppState_RequestBegin | RB. |
eDiagAppState_Request | R. |
eDiagAppState_RequestEnd | RE. |
Definition at line 789 of file ncbidiag.hpp.
enum EDiagCollectMessages |
Flags to control collecting messages and flushing them to the new destination when switching diag handlers.
Definition at line 1798 of file ncbidiag.hpp.
enum EDiagFileType |
CDiagHandler –.
Base diagnostic handler class. Type of file for the output
Enumerator | |
---|---|
eDiagFile_Err | Error log file. |
eDiagFile_Log | Access log file. |
eDiagFile_Trace | Trace log file. |
eDiagFile_Perf | Perf log file. |
eDiagFile_All | All log files. |
Definition at line 2434 of file ncbidiag.hpp.
enum EDiagFilter |
Diag severity types to put the filter on.
Enumerator | |
---|---|
eDiagFilter_Trace | for TRACEs only |
eDiagFilter_Post | for all non-TRACE, non-FATAL |
eDiagFilter_All | for all non-FATAL |
Definition at line 2528 of file ncbidiag.hpp.
enum EDiagPostFlag |
Which parts of the diagnostic context should be posted.
Generic appearance of the posted message is as follows:
[<date> <time> ][T<TID> ][["[<path>]/<file>", ][line <line>]: ] [<severity>: ][(<err_code>.<err_subcode>) ] [<module>[::<class>]::][<function>()] - [<prefix1>::<prefix2>::<prefixN>] <message>
[ [<err_code_message>
] [<err_code_explanation>
]
Example:
Enumerator | |
---|---|
eDPF_File | File name (not full path) |
eDPF_LongFilename | Full file path. |
eDPF_Line | Source line. |
eDPF_Prefix | Prefix (default) |
eDPF_Severity | Severity (default) |
eDPF_ErrorID | Error code and subcode (default) |
eDPF_DateTime | Include date and time. |
eDPF_ErrCodeMessage | Error code message (default) |
eDPF_ErrCodeExplanation | Error explanation (default) |
eDPF_ErrCodeUseSeverity | Use severity from error code (default) |
eDPF_Location | Include class and function if any. |
eDPF_TID | Thread ID. |
eDPF_PID | |
eDPF_SerialNo | |
eDPF_SerialNo_Thread | |
eDPF_RequestId | |
eDPF_Iteration | |
eDPF_UID | |
eDPF_ErrCode | |
eDPF_ErrSubCode | |
eDPF_All | All flags (except for the "unusual" ones!) |
eDPF_Trace | Default flags to use when tracing. |
eDPF_Exception | Default flags to use for exception formatting. |
eDPF_Log | Print the posted message only; without severity, location, prefix, etc. |
eDPF_ErrCodeMsgInFront | Put ErrCode text in front of the message. |
eDPF_MergeLines | Escape EOLs. |
eDPF_PreMergeLines | Obsolete. Use eDPF_MergeLines. |
eDPF_OmitInfoSev | No sev. indication if eDiag_Info. |
eDPF_OmitSeparator | No '—' separator before message. |
eDPF_AppLog | Post message to application log. |
eDPF_IsNote | Print "Note[X]" severity name. |
eDPF_IsMessage | |
eDPF_AtomicWrite | This flag is deprecated and ignored - all log writes are atomic. For compatibility IsSetDiagPostFlag always returns true when asked about this flag. |
eDPF_IsConsole | Send the message to 'console' regardless of it's severity. To be set by 'Console' manipulator only. |
eDPF_Default | Use global default flags (merge with). |
eDPF_ImportantFlagsMask | Important bits which should be taken from the globally set flags even if a user attempts to override (or forgets to set) them when calling CNcbiDiag(). |
eDPF_UseExactUserFlags | Use flags provided by user as-is, do not allow CNcbiDiag to replace "important" flags by the globally set ones. |
Definition at line 692 of file ncbidiag.hpp.
enum EDiagSev |
Severity level for the posted diagnostics.
Definition at line 650 of file ncbidiag.hpp.
enum EDiagSevChange |
Severity level change state.
Enumerator | |
---|---|
eDiagSC_Unknown | Status of changing severity is unknown (first call) |
eDiagSC_Disable | Disable change severity level. |
eDiagSC_Enable | Enable change severity level. |
Definition at line 666 of file ncbidiag.hpp.
enum EDiagTrace |
Which setting disables/enables posting of "eDiag_Trace" messages.
By default, trace messages are disabled unless:
Enumerator | |
---|---|
eDT_Default | Restores the default tracing context. |
eDT_Disable | Ignore messages of severity "eDiag_Trace". |
eDT_Enable | Enable messages of severity "eDiag_Trace". |
Definition at line 1547 of file ncbidiag.hpp.
enum EDiagUserAndHost |
Flags for SetDiagUserAndHost()
Enumerator | |
---|---|
fDiag_AddUser | Add username to diag context. |
fDiag_AddHost | Add hostname to diag context. |
fDiag_OverrideExisting | Set current user and host even if they are already set. |
Definition at line 50 of file ncbi_userhost.hpp.
Compose a message string in the standard format(see also "flags"): "<file>", line <line>: <severity>: [<prefix>] <message> [EOL] and put it to string "str", or write to an output stream "os".
Which write flags should be output in diagnostic message.
Enumerator | |
---|---|
fNone | No flags. |
fNoEndl | No end of line. |
fNoPrefix | No std prefix. |
Definition at line 1702 of file ncbidiag.hpp.
Error types that CRequestContext can generate.
These generic error conditions can occur for corelib applications.
Enumerator | |
---|---|
eBadSession | Invalid session id. |
eBadHit | Invalid hit id. |
Definition at line 620 of file request_ctx.hpp.
Type of event to report.
Definition at line 1640 of file ncbidiag.hpp.
enum CSysLog::EFacility |
Enumerator | |
---|---|
eDefaultFacility | |
eKernel | |
eUser | |
eDaemon | |
eAuth | |
eSysLog | |
eLPR | |
eNews | |
eUUCP | |
eCron | |
eAuthPriv | |
eFTP | |
eLocal0 | |
eLocal1 | |
eLocal2 | |
eLocal3 | |
eLocal4 | |
eLocal5 | |
eLocal6 | |
eLocal7 |
Definition at line 74 of file syslog.hpp.
Enumerator | |
---|---|
fPrintRequestStart | Print request-start automatically in the constructor. By default request-start is not printed to allow the caller log request arguments. |
Definition at line 571 of file request_ctx.hpp.
enum CSysLog::EFlags |
Definition at line 52 of file syslog.hpp.
Supported serialization/deserialization formats.
Enumerator | |
---|---|
eFormat_UrlEncoded | name=value pairs URL-encoded and separated with '&' |
Definition at line 522 of file request_ctx.hpp.
|
private |
Enumerator | |
---|---|
eFormat_Old | |
eFormat_New | |
eFormat_Auto |
Definition at line 1738 of file ncbidiag.hpp.
Hit ID Allowed source of the current hit id.
Enumerator | |
---|---|
eHitID_Any | Any hit id - always return true. |
eHitID_Request | Check if per-request hit id is set. |
eHitID_Default | Check if default hit id is set. |
eHidID_Existing | Check if any hit is already available (will not be generated on request). |
Definition at line 212 of file request_ctx.hpp.
Type of logging rate limit.
Enumerator | |
---|---|
eLogRate_App | Application log. |
eLogRate_Err | Error log. |
eLogRate_Trace | Trace log. |
Definition at line 2276 of file ncbidiag.hpp.
enum ENcbiLog_AppState |
Application execution states shown in the std prefix.
Enumerator | |
---|---|
eNcbiLog_NotSet | Reserved value, never used in messages. |
eNcbiLog_AppBegin | PB. |
eNcbiLog_AppRun | P. |
eNcbiLog_AppEnd | PE. |
eNcbiLog_RequestBegin | RB. |
eNcbiLog_Request | R. |
eNcbiLog_RequestEnd | RE. |
Definition at line 995 of file ncbi_c_log.h.
enum ENcbiLog_Destination |
Where to write the application's diagnostics to.
Enumerator | |
---|---|
eNcbiLog_Default | Try /log/<*>/<appname>.log; fallback to STDERR. |
eNcbiLog_Stdlog | Try /log/<*>/<appname>.log; fallback to . /<appname>.log, then to STDERR |
eNcbiLog_Cwd | Try . /<appname>.log, fallback to STDERR |
eNcbiLog_File | To specific file, see NcbiLog_SetDestinationFile() |
eNcbiLog_Stdout | To standard output stream. |
eNcbiLog_Stderr | To standard error stream. |
eNcbiLog_Disable | Don't write it anywhere. |
Definition at line 246 of file ncbi_c_log.h.
The action passed to user defined MT lock handler.
Enumerator | |
---|---|
eNcbiLog_MT_Init | Init the locker (call first) |
eNcbiLog_MT_Lock | Lock. |
eNcbiLog_MT_Unlock | Unlock. |
eNcbiLog_MT_Destroy | Unlock and cleanup (call last) |
Definition at line 152 of file ncbi_c_log.h.
Type of ownership for MT lock handle.
Enumerator | |
---|---|
eNcbiLog_MT_NoOwnership | No ownership relationship. |
eNcbiLog_MT_TakeOwnership | NcbiLog API takes ownership of MT lock. |
Definition at line 162 of file ncbi_c_log.h.
Actions to perform in NcbiLog_UpdateOnFork()
Enumerator | |
---|---|
fNcbiLog_OnFork_UpdateID | Update IDs (default) |
fNcbiLog_OnFork_PrintStart | Log app-start. |
fNcbiLog_OnFork_ResetTimer | Reset execution timer. |
Definition at line 447 of file ncbi_c_log.h.
enum ENcbiLog_Severity |
Severity level for the posted diagnostics.
Definition at line 261 of file ncbi_c_log.h.
Session ID error actions.
Definition at line 321 of file request_ctx.hpp.
enum EPostNumberIncrement |
Post number increment flag for GetProcessPostNumber() and GetThreadPostNumber().
Enumerator | |
---|---|
ePostNumber_NoIncrement | Get post number without incrementing it. |
ePostNumber_Increment | Increment and return the new post number. |
Definition at line 1811 of file ncbidiag.hpp.
enum CSysLog::EPriority |
Enumerator | |
---|---|
eEmergency | |
eAlert | |
eCritical | |
eError | |
eWarning | |
eNotice | |
eInfo | |
eDebug |
Definition at line 63 of file syslog.hpp.
|
private |
Enumerator | |
---|---|
eProp_RequestID | |
eProp_ClientIP | |
eProp_SessionID | |
eProp_HitID | |
eProp_ReqStatus | |
eProp_BytesRd | |
eProp_BytesWr | |
eProp_Dtab |
Definition at line 408 of file request_ctx.hpp.
Property visibility flag.
Enumerator | |
---|---|
eProp_Default | Auto-mode for known properties, local for others. |
eProp_Global | The property is global for the application. |
eProp_Thread | The property has separate value in each thread. |
Definition at line 2014 of file ncbidiag.hpp.
Enumerator | |
---|---|
fTruncate | Truncate file to zero size. |
fCheck | Reopen only if necessary. |
fDefault | Default reopen flags:
|
Definition at line 2470 of file ncbidiag.hpp.
Session ID format.
Enumerator | |
---|---|
eSID_Ncbi | Strict NCBI format: (UID:16)_(RqID:4+)SID. |
eSID_Standard | Alpanum, underscore, -.:@, (default) |
eSID_Other | Any other format. |
Definition at line 315 of file request_ctx.hpp.
enum CPerfLogger::EStart |
If to start the timing immediately.
Enumerator | |
---|---|
eStart | Call Start() immediately after creating. |
eSuspend | Do not start timer (call Start() later) |
Definition at line 83 of file perf_log.hpp.
|
private |
Enumerator | |
---|---|
fLoggedOnRequest | |
fLoggedOnError |
Definition at line 460 of file request_ctx.hpp.
Actions to perform in UpdateOnFork().
Definition at line 1944 of file ncbidiag.hpp.
NCBI_XNCBI_EXPORT void Abort | ( | void | ) |
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 8147 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().
|
inline |
Add info to the resource's description.
Definition at line 565 of file perf_log.hpp.
References ERR_POST_ONCE, Error(), CPerfLogger::m_IsDiscarded, CPerfLogGuard::m_Logger, CPerfLogGuard::m_Parameters, and rapidjson::value.
Add pass-through value if it matches a pattern from NCBI_CONTEXT_FIELDS.
Definition at line 841 of file request_ctx.cpp.
References NStr::eNocase, CRequestContext::m_PassThroughProperties, mask, CRequestContext::sx_GetContextFieldsMask(), CRequestContext::sx_NormalizeContextPropertyName(), rapidjson::value, and CRequestContext::x_CanModify().
Referenced by CGRPCServerCallbacks::BeginRequest(), and CFastCgiApplicationMT::x_ProcessThreadedRequest().
|
inline |
Adjust the printed elapsed time.
timespan | Adjustment value, can be positive or negative. The value is added to the actual elapsed time before logging it in Post(), if the resuling adjusted timespan is negative, zero is logged. Multiple adjustments are accumulated. |
Definition at line 454 of file perf_log.hpp.
References CTimeSpan::GetAsDouble(), and CPerfLogger::m_Adjustment.
Referenced by g_DoErasePerfLogging(), g_DoPerfLogging(), and s_DoDonePerfLogging().
|
virtual |
Check if the handler supports async writes.
Reimplemented in CFileDiagHandler, and CFileHandleDiagHandler.
Definition at line 6383 of file ncbidiag.cpp.
|
virtual |
Check if the handler supports async writes.
Reimplemented from CDiagHandler.
Definition at line 6661 of file ncbidiag.cpp.
|
virtual |
Check if the handler supports async writes.
Reimplemented from CDiagHandler.
Definition at line 7124 of file ncbidiag.cpp.
References CFileDiagHandler::x_GetDiagFileType(), and CFileDiagHandler::x_GetHandler().
CDiagContext_Extra & CDiagContext_Extra::AllowBadSymbolsInArgNames | ( | void | ) |
Allow bad symbols in argument names.
URL-encode names the same way as values. NOTE: Avoid using this method if possible. Argument names with encoded symbols may be incompatible with some logging tools. If the flag is not set, any bad symbol is replaced with [ILLEGAL_APPLOG_SYMBOL:%##] string, where %## is the URL-encoded symbol.
Definition at line 2213 of file ncbidiag.cpp.
References CDiagContext_Extra::m_AllowBadNames.
void AppendDiagFilter | ( | EDiagFilter | what, |
const char * | filter_str | ||
) |
Append diagnostic filter.
what | Filter is set for |
filter_str | Filter string |
Definition at line 7694 of file ncbidiag.cpp.
References eDiagFilter_All, eDiagFilter_Post, eDiagFilter_Trace, CDiagLock::eWrite, s_PostFilter, and s_TraceFilter.
|
private |
Definition at line 1476 of file ncbidiag.cpp.
References eDiag_Info, eDiag_Trace, eDPF_AppLog, IsSetDiagPostFlag(), CDiagContext::m_AppLogRC, CDiagContext::m_AppLogSuspended, CDiagContext::m_ErrLogRC, CDiagContext::m_ErrLogSuspended, SDiagMessage::m_Flags, SDiagMessage::m_Severity, CDiagContext::m_TraceLogRC, and CDiagContext::m_TraceLogSuspended.
CAsyncDiagHandler::CAsyncDiagHandler | ( | void | ) |
Definition at line 7209 of file ncbidiag.cpp.
CDiagAutoPrefix::CDiagAutoPrefix | ( | const char * | prefix | ) |
Constructor.
Definition at line 6014 of file ncbidiag.cpp.
References prefix, and PushDiagPostPrefix().
Constructor.
Definition at line 6009 of file ncbidiag.cpp.
References prefix, and PushDiagPostPrefix().
CDiagCollectGuard::CDiagCollectGuard | ( | EDiagSev | print_severity | ) |
Set collectable severity and optionally applied print-severity cap to the current post level, Print severity is set to the specified value but can be ignored if it's lower than the currently set post level (or print severity set by a higher level guard).
The default action is eDiscard.
Definition at line 522 of file ncbidiag.cpp.
References eDiag_Critical, CDiagCollectGuard::eDiscard, and CDiagCollectGuard::x_Init().
CDiagCollectGuard::CDiagCollectGuard | ( | EDiagSev | print_severity, |
EDiagSev | collect_severity, | ||
EAction | action = eDiscard |
||
) |
Create diag collect guard with the given severities and action.
As with the other constructor variants, the optionally applied print-severity cap defaults to the collectable severity. The guard will not set print severity below the current diag post level (or print severity of a higher level guard). Collect severity should be equal or lower than the current diag post level or collect severity. The default action is eDiscard.
Definition at line 529 of file ncbidiag.cpp.
References CDiagCollectGuard::x_Init().
CDiagCollectGuard::CDiagCollectGuard | ( | void | ) |
Set collectable severity and optionally applied print-severity cap to the current post level, Print severity is set to critical.
The default action is eDiscard.
Definition at line 515 of file ncbidiag.cpp.
References eDiag_Critical, eDiag_Fatal, CDiagCollectGuard::eDiscard, and CDiagCollectGuard::x_Init().
CDiagCompileInfo::CDiagCompileInfo | ( | const char * | file, |
int | line, | ||
const char * | curr_funct = NULL , |
||
const char * | module = NULL |
||
) |
Definition at line 655 of file ncbidiag.cpp.
References file, CDiagCompileInfo::m_File, CDiagCompileInfo::m_Module, util::strcmp(), and CDiagCompileInfo::x_NeedModule().
CDiagCompileInfo::CDiagCompileInfo | ( | const string & | file, |
int | line, | ||
const string & | curr_funct, | ||
const string & | module | ||
) |
Definition at line 1309 of file logging.cpp.
References file, CDiagCompileInfo::m_CurrFunctName, CDiagCompileInfo::m_File, CDiagCompileInfo::m_StrCurrFunctName, and CDiagCompileInfo::m_StrFile.
CDiagCompileInfo::CDiagCompileInfo | ( | void | ) |
Definition at line 1284 of file logging.cpp.
|
private |
CDiagContext::CDiagContext | ( | void | ) |
Definition at line 1298 of file ncbidiag.cpp.
References eStart, and CDiagContext::sm_Instance.
CDiagContext_Extra::CDiagContext_Extra | ( | const CDiagContext_Extra & | args | ) |
Copying the object will prevent printing it on destruction.
The new copy should take care of printing.
Definition at line 2199 of file ncbidiag.cpp.
|
private |
Definition at line 2181 of file ncbidiag.cpp.
References CDiagContext_Extra::m_Args.
|
private |
Definition at line 2168 of file ncbidiag.cpp.
CDiagErrCodeInfo::CDiagErrCodeInfo | ( | CNcbiIstream & | is | ) |
Constructor – can throw runtime_error.
Constructor – can throw runtime_error.
CDiagErrCodeInfo::CDiagErrCodeInfo | ( | void | ) |
Constructor.
CDiagRestorer::CDiagRestorer | ( | void | ) |
Captures current settings.
Definition at line 7980 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 | ( | void | ) |
Constructor.
initializes log file(s) with the arguments.
Definition at line 6727 of file ncbidiag.cpp.
References eDiagFile_All, and CFileDiagHandler::SetLogFile().
CFileHandleDiagHandler::CFileHandleDiagHandler | ( | const string & | fname, |
EDiagFileType | file_type = eDiagFile_All |
||
) |
Constructor.
Open file handle. themselves if appropriate.
fname | Output file name. |
file_type | Type of log file. |
Definition at line 6490 of file ncbidiag.cpp.
References CDiagHandler::fDefault, CDiagHandler::fTruncate, CDiagContext::GetLogTruncate(), CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::SetLogName().
|
inline |
Additional dummy function for use in NCBI_CHECK_ERR_SUBCODE_X macro.
Definition at line 442 of file ncbidiag.hpp.
bool CNcbiDiag::CheckFilters | ( | const CException * | ex = NULL | ) | const |
Check if filters are passed for the current message.
In addition check an exception and all its backlog if specified.
Definition at line 7774 of file ncbidiag.cpp.
References eDiag_Fatal, eDiag_Trace, eDiagFilter_Reject, CDiagLock::eRead, CNcbiDiag::GetSeverity(), s_PostFilter, and s_TraceFilter.
Referenced by CNcbiDiag::x_Put().
Create tracer using the service name and the environment varibles to populate configuration.
Definition at line 94 of file jaeger_tracer.cpp.
References s_GetDefaultConfig(), and s_InitTracer().
Create tracer using the service name and config.
Definition at line 101 of file jaeger_tracer.cpp.
References s_InitTracer().
CJaegerTracer::CJaegerTracer | ( | void | ) |
Create tracer using default settings:
Definition at line 82 of file jaeger_tracer.cpp.
References CNcbiApplicationAPI::InstanceGuard(), s_GetDefaultConfig(), and s_InitTracer().
|
inline |
Definition at line 57 of file jaeger_tracer.hpp.
void CDiagErrCodeInfo::Clear | ( | void | ) |
Delete all stored error descriptions from memory.
CRef< CRequestContext > CRequestContext::Clone | ( | void | ) | const |
Copy current request context to a new one.
The method can be used to process a single request in several threads which share the same information (request id, session id etc.). NOTE: The new context is not linked to the parent one. No further changes in a context are copied to its clones. It's the developer's responsibility to track multiple clones and make sure that they are used properly (e.g. status is set by just one thread; only one request-stop is printed and no clones continue to log the same request after it's stopped).
Definition at line 571 of file request_ctx.cpp.
References CEncodedString::GetOriginalString(), CRequestContext::m_AppState, CRequestContext::m_AutoIncOnPost, CRequestContext::m_BytesRd, CRequestContext::m_BytesWr, CRequestContext::m_ClientIP, CRequestContext::m_Dtab, CRequestContext::m_Flags, CRequestContext::m_HitID, CRequestContext::m_HitIDLoggedFlag, CRequestContext::m_IsReadOnly, CRequestContext::m_IsRunning, CRequestContext::m_Properties, CRequestContext::m_PropSet, CRequestContext::m_ReqStatus, CRequestContext::m_ReqTimer, CRequestContext::m_RequestID, CRequestContext::m_SessionID, CRequestContext::m_SubHitIDCache, CSharedHitId::SetShared(), and CEncodedString::SetString().
Referenced by CPSG_Request::GetCtx(), CAsyncWriteCache::GetWriteStream(), CThread::Run(), and CPSGS_Request::SetRequestContext().
CNcbiDiag::CNcbiDiag | ( | const CDiagCompileInfo & | info, |
EDiagSev | sev = eDiag_Error , |
||
TDiagPostFlags | post_flags = eDPF_Default |
||
) |
Constructor – includes the file and line number info.
info | File, line, module |
sev | Severity level |
post_flags | What to post |
Definition at line 7720 of file ncbidiag.cpp.
CNcbiDiag::CNcbiDiag | ( | EDiagSev | sev = eDiag_Error , |
TDiagPostFlags | post_flags = eDPF_Default |
||
) |
Constructor.
sev | Severity level |
post_flags | What to post |
Definition at line 7709 of file ncbidiag.cpp.
Referenced by CNcbiDiag::DiagAssert(), CNcbiDiag::DiagFatal(), and CNcbiDiag::DiagTrouble().
Load fields to be logged from NCBI_LOG_FIELDS environment variable.
Definition at line 3897 of file ncbidiag.cpp.
References _T_CSTRING, _TX, NStr::fSplit_Tokenize, CNcbiLogFields::m_Fields, NcbiSys_getenv, NStr::ReplaceInPlace(), NStr::Split(), and NStr::ToLower().
Compare two severities.
Definition at line 6157 of file ncbidiag.cpp.
References eDiag_Trace.
Referenced by AdjustApplogPrintableSeverity(), CException::CException(), CException::GetStackTrace(), IsVisibleDiagPostLevel(), CTeeDiagHandler::Post(), CPythonDiagHandler::Post(), CDiagContextThreadData::RemoveCollectGuard(), CDiagCollectGuard::SetCollectSeverity(), CDiagCollectGuard::SetPrintSeverity(), CException::SetSeverity(), CException::x_GetStackTrace(), CDiagCollectGuard::x_Init(), and CNcbiDiag::x_Put().
|
virtual |
Compose message without writing it.
If async mode is not supported, return empty string.
Reimplemented in CFileDiagHandler, and CFileHandleDiagHandler.
Definition at line 6389 of file ncbidiag.cpp.
References _ASSERT, and kEmptyStr.
Referenced by CAsyncDiagHandler::Post().
|
virtual |
Compose message without writing it.
If async mode is not supported, return empty string.
Reimplemented from CDiagHandler.
Definition at line 6667 of file ncbidiag.cpp.
Referenced by CFileHandleDiagHandler::Post(), and CFileHandleDiagHandler::Reopen().
|
virtual |
Compose message without writing it.
If async mode is not supported, return empty string.
Reimplemented from CDiagHandler.
Definition at line 7131 of file ncbidiag.cpp.
References file_type, kEmptyStr, CFileDiagHandler::x_GetDiagFileType(), and CFileDiagHandler::x_GetHandler().
|
inline |
Constructor.
Use start time and elapsed time values from a previous logger to continue measuring an operation.
Definition at line 368 of file perf_log.hpp.
References CPerfLogger::eStart, CStopWatch::eStop, CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_FirstStartTime, CPerfLogger::m_IsDiscarded, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, CPerfLogger::Start(), and start_time.
|
inline |
Constructor.
Use the provided stopwatch to track time. Start or stop the stopwatch according to the 'state'. The same stopwatch object can be used multiple times to accumulate total time for several operations.
Definition at line 383 of file perf_log.hpp.
References CPerfLogger::eStart, CStopWatch::eStop, CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_IsDiscarded, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, and CPerfLogger::Start().
Constructor. Starts the timer by default.
Definition at line 354 of file perf_log.hpp.
References CPerfLogger::eStart, CStopWatch::eStop, CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_IsDiscarded, CPerfLogger::m_StopWatch, CPerfLogger::m_TimerState, and CPerfLogger::Start().
|
inline |
Constructor.
Use the provided start and elapsed times to initialize the logger and continue to measure an operation.
resource | Name of the resource (must be non-empty, else throws an exception). |
start_time | Start time, usually obtained from a previous logger to continue measuring an operation. |
elapsed_time | Elapsed time in seconds obtained from a previous logger. |
state | Whether to start the timer by default. |
Definition at line 511 of file perf_log.hpp.
References CTempString::empty(), and NCBI_THROW.
|
inline |
Constructor.
resource | Name of the resource (must be non-empty, else throws an exception). |
state | Whether to start the timer by default. |
Definition at line 500 of file perf_log.hpp.
References CTempString::empty(), and NCBI_THROW.
|
inline |
Constructor.
resource | Name of the resource (must be non-empty, else throws an exception). Constructor. Use the provided stopwatch to track time. |
stopwatch | User-provided stopwatch to use for tracking time. The same stopwatch object can be used multiple times to accumulate total time for several operations. |
state | Whether to start the timer by default. |
Definition at line 525 of file perf_log.hpp.
References CTempString::empty(), and NCBI_THROW.
|
private |
CRequestContext::CRequestContext | ( | TContextFlags | flags = fDefault | ) |
Definition at line 165 of file request_ctx.cpp.
References eStop, and CRequestContext::x_LoadEnvContextProperties().
|
inline |
Get CRequestContext_PassThrough for the specific request context.
Definition at line 972 of file request_ctx.hpp.
|
inline |
Get CRequestContext_PassThrough for the current request context.
Definition at line 965 of file request_ctx.hpp.
References GetDiagContext(), CRequestContext_PassThrough::m_Context, and CRef< C, Locker >::Reset().
CRequestContextGuard_Base::CRequestContextGuard_Base | ( | CRequestContext * | context, |
TFlags | flags = 0 |
||
) |
Initialize guard.
context | Request context to be used. If null, re-use current context. |
flags | Optional flags, |
Definition at line 901 of file request_ctx.cpp.
References context, ctx, CRequestContextGuard_Base::fPrintRequestStart, GetDiagContext(), CRequestContextGuard_Base::m_Flags, CRequestContextGuard_Base::m_OriginatesFromThrow, CRequestContextGuard_Base::m_RequestContext, CRequestContextGuard_Base::m_SavedContext, and CRef< C, Locker >::Reset().
Set new hit id, checks its validity.
Definition at line 68 of file request_ctx.hpp.
References CSharedHitId::x_SetHitId().
|
inline |
Definition at line 74 of file request_ctx.hpp.
CStreamDiagHandler::CStreamDiagHandler | ( | CNcbiOstream * | os, |
bool | quick_flush = true , |
||
const string & | stream_name = "" |
||
) |
Constructor.
This does *not* own the stream; users will need to clean it up themselves if appropriate.
os | Output stream. |
quick_flush | Do stream flush after every message. |
Definition at line 6422 of file ncbidiag.cpp.
References CStreamDiagHandler_Base::SetLogName().
CStreamDiagHandler_Base::CStreamDiagHandler_Base | ( | void | ) |
Definition at line 6402 of file ncbidiag.cpp.
References kLogName_Stream, and CStreamDiagHandler_Base::SetLogName().
Definition at line 75 of file syslog.cpp.
References CSysLog::fConnectNow, flags, NCBI_THROW, and CSysLog::x_Connect().
CSysLog::CSysLog | ( | const string & | ident = kEmptyStr , |
TFlags | flags = fNoOverride , |
||
EFacility | default_facility = eDefaultFacility |
||
) |
Definition at line 60 of file syslog.cpp.
References CSysLog::fConnectNow, flags, NCBI_THROW, and CSysLog::x_Connect().
|
private |
void CDiagContext::DeleteProperty | ( | const string & | name, |
EPropertyMode | mode = eProp_Default |
||
) |
Delete a property by name.
If mode is eProp_Default and the property is not a known one, check thread-local properties first.
Definition at line 2073 of file ncbidiag.cpp.
References map_checker< Container >::end(), map_checker< Container >::erase(), CDiagLock::eRead, map_checker< Container >::find(), and CDiagContext::m_Properties.
void CRequestContext_PassThrough::Deserialize | ( | CTempString | data, |
EFormat | format | ||
) |
Deserialize values using the specified format.
Definition at line 864 of file request_ctx.cpp.
References data, CRequestContext_PassThrough::eFormat_UrlEncoded, format, CRequestContext_PassThrough::m_Context, CRequestContext_PassThrough::x_DeserializeUrlEncoded(), and CRequestContext::x_UpdateStdContextProp().
Referenced by SetSessionAndIPAndPHID(), and CCgiRequest::x_InitRequestContext().
|
static |
Assert specified expression and report results.
Definition at line 7944 of file ncbidiag.cpp.
References Abort(), CNcbiDiag::CNcbiDiag(), eDiag_Fatal, eDPF_Trace, CNcbiDiag::Endm, and info.
Referenced by CNcbiDiag::DiagAssertIfSuppressedSystemMessageBox(), and CNcbiDiag::DiagValidate().
|
static |
Same as DiagAssert but only if the system message box is suppressed.
Definition at line 7955 of file ncbidiag.cpp.
References CNcbiDiag::DiagAssert(), info, and IsSuppressedDebugSystemMessageBox().
|
static |
Display fatal error message.
Definition at line 7929 of file ncbidiag.cpp.
References Abort(), CNcbiDiag::CNcbiDiag(), eDiag_Fatal, CNcbiDiag::Endm, and info.
void DiagHandler_Reopen | ( | void | ) |
Ask diagnostic handler to reopen log files if necessary.
Definition at line 6344 of file ncbidiag.cpp.
References CDiagHandler::fCheck, and GetDiagHandler().
Referenced by CDefaultIdler::Idle().
|
static |
Display trouble error message.
Definition at line 7938 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().
|
static |
Display validation message.
Definition at line 7965 of file ncbidiag.cpp.
References CNcbiDiag::DiagAssert(), CCoreException::eCore, eValidate_Throw, info, and xncbi_GetValidateAction().
Disable change the diagnostic post level.
Consecutive using SetDiagPostLevel() will not have effect.
Definition at line 6186 of file ncbidiag.cpp.
References eDiagSC_Disable, eDiagSC_Enable, and CDiagLock::eWrite.
Referenced by SetDiagFixedPostLevel().
|
inline |
Discard the timing results; stop and deactivate the timer.
Definition at line 445 of file perf_log.hpp.
References CStopWatch::eStop, CPerfLogger::m_IsDiscarded, and CPerfLogger::m_TimerState.
Referenced by CPerfLogGuard::Discard(), and CPerfLogger::Post().
|
inline |
Discard the results.
Definition at line 586 of file perf_log.hpp.
References CPerfLogger::Discard(), and CPerfLogGuard::m_Logger.
Referenced by CPerfLogGuard::Post().
void CDiagContext::DiscardMessages | ( | void | ) |
Discard the collected messages without printing them.
Definition at line 3411 of file ncbidiag.cpp.
References CDiagContext::m_Messages.
Referenced by CNcbiApplicationAPI::AppMain(), and CNcbiApplicationAPI::FlushDiag().
|
inline |
Definition at line 77 of file request_ctx.hpp.
References CSharedHitId::m_HitId.
Referenced by CRequestContext::x_GetHitID(), CRequestContext::x_LogHitID(), and CRequestContext::x_LogHitIDOnError().
|
inline |
Enumerate all properties.
The callback must have the following signarure: bool F(const string& name, const string& value); The function should return true to continue enumaration, false to stop.
Definition at line 548 of file request_ctx.hpp.
References ITERATE, CRequestContext_PassThrough::m_Context, CRequestContext::m_PassThroughProperties, and CRequestContext::x_UpdateStdPassThroughProp().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata().
Constructor.
Definition at line 818 of file ncbidiag.hpp.
|
inline |
Create a temporary CDiagContext_Extra object.
The object will print arguments automatically from destructor. Can be used like: Extra().Print(name1, val1).Print(name2, val2);
Definition at line 2095 of file ncbidiag.hpp.
References CDiagContext::CDiagContext_Extra, and SDiagMessage::eEvent_Extra.
Referenced by CGRPCRequestLogger::CGRPCRequestLogger(), CWNJobWatcher::CheckForInfiniteLoop(), CCgi2RCgiApp::CheckJob(), CVcfTrack::CheckRange(), CompressAssembly(), ColumnarVcfCache::CreateBlob(), CBlastAligner::GenerateAlignments(), CNcbiLogFields::LogFields(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), CPerfLogger::Post(), CDiagContext::PrintStart(), CCgiSampleApplication::ProcessPrintEnvironment(), COperationTiming::Register(), CIgBlast::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), CNetStorageGCApp::Run(), CAdvancedAlignCleanup::RunSplignOnCompartment(), CSparseGraph::Save(), ColumnarVcfCache::SetInfoFields(), CCgi2RCgiApp::SubmitJob(), UncomressAndCreate(), CNgAligner::x_Align_Impl(), CQueue::x_CancelJobs(), CQueue::x_CheckExecutionTimeout(), CSparseGraph::x_CheckRemoteData(), CQueueDataBase::x_CreateAndMountQueue(), CPubseqGatewayApp::x_DispatchRequest(), CSGAlignStatJob::x_Execute(), CNetStorageHandler::x_GetObject(), CGRPCRequestLogger::x_Init(), CNetScheduleHandler::x_LogCommandWithJob(), CDBConnectionFactory::x_LogConnection(), CDiagContext::x_LogEnvironment(), CRequestContext::x_LogHitID(), CDiagContext::x_LogHitID(), CNcbiApplicationAPI::x_LogOptions(), CQueue::x_LogSubmit(), CHttpConnection::x_MaintainBacklog(), CCgiApplication::x_OnEvent(), CQueueDataBase::x_Open(), CNetStorageGCApp::x_PrintFinishCounters(), CNetScheduleHandler::x_PrintGetJobResponse(), CNetStorageHandler::x_PrintMessageRequestStop(), CNetScheduleHandler::x_ProcessChangeAffinity(), CNetScheduleHandler::x_ProcessClearWorkerNode(), CNetStorageHandler::x_ProcessCreate(), CNetScheduleHandler::x_ProcessGetJob(), CNetScheduleHandler::x_ProcessJobExchange(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessReading(), CNetStorageHandler::x_ProcessReconfigure(), CNetScheduleHandler::x_ProcessReloadConfig(), CNetStorageHandler::x_ProcessRelocate(), CNetScheduleHandler::x_ProcessSetAffinity(), CNetScheduleHandler::x_ProcessSetQueue(), CInstancedAligner::x_RunAligner(), CSparseGraph::x_Sync(), and CRequestContext::x_UpdateSubHitID().
void CDiagContext_Extra::Flush | ( | void | ) |
Print the message and reset object.
The object can then be reused to print a new log line (with a new set of arguments if necessary). This is only possible with 'extra' messages, request start/stop messages can not be reused after flush and will print error message instead.
Definition at line 2332 of file ncbidiag.cpp.
References ctx, NStr::DoubleToString(), eDiag_Info, eDiagAppState_AppRun, eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, SDiagMessage::eEvent_Extra, SDiagMessage::eEvent_PerfLog, SDiagMessage::eEvent_RequestStart, SDiagMessage::eEvent_RequestStop, SDiagMessage::eEvent_Start, NStr::fDoubleFixed, CNcbiDiag::ForceImportantFlags(), GetDiagBuffer(), GetDiagContext(), CDiagContext::IsSetOldPostFormat(), kApplogDiagPostFlags, SDiagMessage::m_AllowBadExtraNames, CDiagContext_Extra::m_AllowBadNames, CDiagContext_Extra::m_Args, SDiagMessage::m_Event, CDiagContext_Extra::m_EventType, SDiagMessage::m_ExtraArgs, CDiagContext_Extra::m_Flushed, CDiagContext_Extra::m_PerfStatus, CDiagContext_Extra::m_PerfTime, CDiagContext_Extra::m_Typed, SDiagMessage::m_TypedExtra, NULL, CDiagContext_Extra::PrintNcbiAppInfoOnRequest(), CDiagContext_Extra::PrintNcbiRoleAndLocation(), s_DisableAppLog, and CDiagContext::x_StartRequest().
Referenced by CGRPCServerCallbacks::BeginRequest(), CNetScheduleServer::Exit(), CStatisticsCounters::PrintServerWide(), CDiagContext::PrintStart(), CQueue::PrintStatistics(), CPubseqGatewayApp::x_CreateRequestContext(), CDiagContext::x_LogEnvironment(), CQueue::x_LogSubmit(), CCgiApplication::x_OnEvent(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageHandler::x_PrintMessageRequestStart(), and CDiagContext_Extra::x_Release().
void CDiagContext::FlushMessages | ( | CDiagHandler & | handler | ) |
Flush the collected messages to the current diag handler.
Does not clear the collected messages.
Definition at line 3387 of file ncbidiag.cpp.
References eDPF_IsConsole, CTeeDiagHandler::GetOriginalHandler(), CDiagContext::m_Messages, NON_CONST_ITERATE, and tmp.
Referenced by CNcbiApplicationAPI::FlushDiag().
|
static |
Set important flags to their globally set values.
Definition at line 7737 of file ncbidiag.cpp.
References eDPF_ImportantFlagsMask, eDPF_UseExactUserFlags, flags, and IsSetDiagPostFlag().
Referenced by CDiagContext_Extra::Flush(), and CDiagContext::x_PrintMessage().
string SDiagMessage::FormatExtraMessage | ( | void | ) | const |
Convert extra arguments to string.
Definition at line 5485 of file ncbidiag.cpp.
References SDiagMessage::m_AllowBadExtraNames, SDiagMessage::m_ExtraArgs, and CStringPairs< TContainer >::Merge().
Referenced by SDiagMessage::x_NewWrite().
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().
const char* g_DiagUnknownFunction | ( | void | ) |
Definition at line 8341 of file ncbidiag.cpp.
References kEmptyCStr.
Referenced by s_NCBI_GPR_Log_Function().
|
inline |
Get current property value or empty string if it's not set;.
Definition at line 993 of file request_ctx.hpp.
References CRequestContext_PassThrough::m_Context, and CRequestContext::x_GetPassThroughProp().
Referenced by CNetStorageHandler::x_CreateUser().
|
inline |
Get selected on-destroy action.
Definition at line 1360 of file ncbidiag.hpp.
References CDiagCollectGuard::m_Action.
Referenced by CDiagContextThreadData::RemoveCollectGuard().
|
static |
Get/set allowed session id format.
Definition at line 559 of file request_ctx.cpp.
Referenced by CRequestContext::IsValidSessionID().
Definition at line 5991 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetEncodedAppName(), SDiagMessageData::m_AppName, and SDiagMessage::m_Data.
Referenced by CDiagContext::WriteStdPrefix().
Get application name.
Definition at line 1857 of file ncbidiag.cpp.
References CNcbiApplicationAPI::GetAppName(), CNcbiApplication::Instance(), CDiagContext::m_AppName, and CDiagContext::m_AppNameSet.
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), CDiagContext::GetEncodedAppName(), CDiagContext::GetProperty(), and CTLibContext::InitApplicationName().
EDiagAppState SDiagMessage::GetAppState | ( | void | ) | const |
Definition at line 6000 of file ncbidiag.cpp.
References CDiagContext::GetAppState(), GetDiagContext(), SDiagMessageData::m_AppState, and SDiagMessage::m_Data.
Referenced by SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().
EDiagAppState CDiagContext::GetAppState | ( | void | ) | const |
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 2802 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().
EDiagAppState CRequestContext::GetAppState | ( | void | ) | const |
Application state.
Definition at line 257 of file request_ctx.cpp.
References eDiagAppState_NotSet, GetDiagContext(), CDiagContext::GetGlobalAppState(), and CRequestContext::m_AppState.
Referenced by CDiagContext::GetAppState(), and SWorkerNodeJobContextImpl::x_PrintRequestStop().
|
inline |
Get auto-increment state.
Definition at line 306 of file request_ctx.hpp.
References CRequestContext::m_AutoIncOnPost.
Referenced by SDiagMessage::SDiagMessage().
|
static |
Get/set session id error action.
Definition at line 547 of file request_ctx.cpp.
Referenced by CRequestContext::SetSessionID().
|
inline |
Bytes read.
Definition at line 858 of file request_ctx.hpp.
References CRequestContext::eProp_BytesRd, CRequestContext::m_BytesRd, and CRequestContext::x_IsSetProp().
|
inline |
Bytes written.
Definition at line 887 of file request_ctx.hpp.
References CRequestContext::eProp_BytesWr, CRequestContext::m_BytesWr, and CRequestContext::x_IsSetProp().
const char* CNcbiDiag::GetClass | ( | void | ) | const |
Get class name of the current message.
Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().
string SDiagMessage::GetClient | ( | void | ) | const |
Definition at line 5977 of file ncbidiag.cpp.
References CRequestContext::GetClientIP(), CDiagContext::GetRequestContext(), SDiagMessageData::m_Client, and SDiagMessage::m_Data.
Referenced by CDiagContext::WriteStdPrefix().
|
inline |
Client IP/hostname.
Definition at line 673 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(), COSGFetch::SetContext(), SDiagMessage::x_SaveContextData(), CNCActiveHandler::x_SendCopyPutCmd(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Get current collect severity.
Definition at line 1349 of file ncbidiag.hpp.
References CDiagCollectGuard::m_CollectSev.
Referenced by CDiagContextThreadData::RemoveCollectGuard(), CDiagCollectGuard::x_Init(), and CNcbiDiag::x_Put().
|
inline |
Get the last generated sub-hit id.
Definition at line 783 of file request_ctx.hpp.
References CRequestContext::m_SubHitIDCache, prefix, and CRequestContext::x_UpdateSubHitID().
Referenced by COSGFetch::SetContext(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Get current sub-hit id value.
Definition at line 105 of file request_ctx.hpp.
References CSharedHitId::IsShared(), CSharedHitId::m_SharedSubHitId, and CSharedHitId::m_SubHitId.
Referenced by CRequestContext::x_UpdateSubHitID().
|
static |
Get default auto-increment flag.
Definition at line 383 of file request_ctx.cpp.
References CRequestContext::sx_GetDefaultAutoIncRequestIDOnPost().
Referenced by CDiagContextThreadData::CDiagContextThreadData().
|
static |
Get default client ip.
The ip may be set using SetDefaultClientIP(), NCBI_LOG_CLIENT_IP env. variable or Log.Client_Ip value in the INI file.
Definition at line 2932 of file ncbidiag.cpp.
References s_DefaultClientIp.
Referenced by CRequestContext::GetClientIP(), CRequestContext::IsSetClientIP(), and CDiagContext::x_StartRequest().
string CDiagContext::GetDefaultHitID | ( | void | ) | const |
Get global default hit id.
The hit id may be set using SetDefaultHitId(), HTTP_NCBI_PHID or NCBI_LOG_HIT_ID env. variables, or Log.Http_Hit_Id/Log.Hit_Id values in the INI file. The Http-value has higher priority. If none of the values is set, the default hit id is generated automatically.
Definition at line 1748 of file ncbidiag.cpp.
References CDiagContext::eHitID_Create, CSharedHitId::GetHitId(), and CDiagContext::x_GetDefaultHitID().
string CDiagContext::GetDefaultSessionID | ( | void | ) | const |
Get default session id.
The session id may be set using SetDefaultSessionId(), NCBI_LOG_SESSION_ID env. variable or Log.Session_Id value in the INI file.
Definition at line 868 of file logging.cpp.
References kEmptyStr.
Referenced by CDiagContext::GetSessionID(), CRequestContext::GetSessionID(), and CRequestContext::IsSetSessionID().
bool CDiagErrCodeInfo::GetDescription | ( | const ErrCode & | err_code, |
SDiagErrCodeDescription * | description | ||
) | const |
Get description for specified error code.
Get description message for the error by its code.
Definition at line 8323 of file ncbidiag.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), and CDiagErrCodeInfo::m_Info.
CDiagContext& GetDiagContext | ( | void | ) |
Get diag context instance.
Definition at line 818 of file logging.cpp.
References ctx, CSafeStaticLifeSpan::eLifeSpan_Long, and CSafeStatic< T, Callbacks >::Get().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), CNcbiApplicationAPI::AppMain(), CCgiApplication::AppStart(), CNcbiApplicationAPI::AppStart(), CCgiApplication::AppStop(), CNcbiApplicationAPI::AppStop(), CNcbiTestsObserver::assertion_result(), CGRPCServerCallbacks::BeginRequest(), CWNJobWatcher::CheckForInfiniteLoop(), CCgi2RCgiApp::CheckJob(), CVcfTrack::CheckRange(), CNSClientsRegistry::ClearOnTimeout(), CGridCommandLineInterfaceApp::Cmd_Login(), CNcbiApplicationAPI::CNcbiApplicationAPI(), CompressAssembly(), ColumnarVcfCache::CreateBlob(), CreateErrorRequestContext(), CRequestContext_PassThrough::CRequestContext_PassThrough(), CRequestContextGuard_Base::CRequestContextGuard_Base(), DismissErrorRequestContext(), CGRPCServerCallbacks::EndRequest(), CRemoteAppLauncher::ExecRemoteApp(), NAutomation::CAutomationProc::ExecSetContext(), SAsyncWriteTask::Execute(), CNetScheduleServer::Exit(), CDiagContext_Extra::Flush(), CNcbiApplicationAPI::FlushDiag(), g_PostPerf(), CBlastAligner::GenerateAlignments(), SDiagMessage::GetAppName(), SDiagMessage::GetAppState(), CRequestContext::GetAppState(), CRequestContext::GetClientIP(), GetDiagRequestId(), CRequestContext::GetEncodedSessionID(), SDiagMessage::GetHost(), SDiagMessage::GetSession(), CRequestContext::GetSessionID(), SDiagMessage::GetUID(), CAsyncWriteCache::GetWriteStream(), SNetScheduleAPIImpl::Init(), CTLibContext::InitApplicationName(), CRequestContext::IsSetClientIP(), CRequestContext::IsSetHitID(), CRequestContext::IsSetSessionID(), CNcbiLogFields::LogFields(), CCgiApplication::LogRequest(), main(), Main(), NcbiSys_main(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), CPerfLogger::Post(), CStatisticsCounters::PrintServerWide(), CQueue::PrintStatistics(), CGetStatisticsProcessor::Process(), CCgiSampleApplication::ProcessPrintEnvironment(), COperationTiming::Register(), CRequestContextGuard_Base::Release(), CNetStorageGCDatabase::RemoveObject(), CIgBlast::Run(), CCgiApplication::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), CNetStorageGCApp::Run(), CExec::RunSilent(), CAdvancedAlignCleanup::RunSplignOnCompartment(), s_Daemonize(), s_GetNextLogPrefix(), s_GetOtherArgs(), s_SpawnUnix(), CSparseGraph::Save(), SetDiagHandler(), SetDiagRequestId(), SetDiagUserAndHost(), CSharedHitId::SetHitId(), CRequestContext::SetHitID(), ColumnarVcfCache::SetInfoFields(), CCgiResponse::SetMultipartMode(), CNcbiApplicationAPI::SetProgramDisplayName(), CRequestContext::SetSessionID(), CGridCommandLineInterfaceApp::SetUp_NetStorageCmd(), CDiagContext::SetupDiag(), CExec::SpawnL(), CExec::SpawnLE(), CExec::SpawnLP(), CExec::SpawnLPE(), CExec::SpawnV(), CExec::SpawnVE(), CExec::SpawnVP(), CExec::SpawnVPE(), CLogLatencyReport::Start(), CCgi2RCgiApp::SubmitJob(), CDiagContext::sx_ThreadDataTlsCleanup(), UncomressAndCreate(), CDiagContext::UpdatePID_AsyncSafe(), CCgiResponse::WriteHeader(), CNgAligner::x_Align_Impl(), CQueue::x_CancelJobs(), CQueue::x_CheckExecutionTimeout(), CSparseGraph::x_CheckRemoteData(), CQueueDataBase::x_CreateAndMountQueue(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CPubseqGatewayApp::x_CreateRequestContext(), CPubseqGatewayApp::x_DispatchRequest(), CGetJobNotificationThread::x_DoJob(), CJobQueueCleanerThread::x_DoJob(), CJobQueueExecutionWatcherThread::x_DoJob(), CSGAlignStatJob::x_Execute(), CNetStorageHandler::x_GetConnRef(), CNetScheduleHandler::x_GetConnRef(), CRequestContext::x_GetHitID(), CNetStorageHandler::x_GetObject(), CException::x_Init(), SDiagMessage::x_InitData(), CCgiContext::x_InitSession(), SDiagMessage::x_IsSetOldFormat(), CNetScheduleHandler::x_LogCommandWithJob(), CDBConnectionFactory::x_LogConnection(), CDiagContext::x_LogEnvironment(), CRequestContext::x_LogHitID(), CNcbiApplicationAPI::x_LogOptions(), CQueue::x_LogSubmit(), CHttpConnection::x_MaintainBacklog(), SDiagMessage::x_NewWrite(), CCgiApplication::x_OnEvent(), CQueueDataBase::x_Open(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetScheduleHandler::x_PrintCmdRequestStop(), CNetStorageGCApp::x_PrintFinishCounters(), CNetScheduleHandler::x_PrintGetJobResponse(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetStorageHandler::x_PrintMessageRequestStop(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), CPubseqGatewayApp::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessChangeAffinity(), CNetScheduleHandler::x_ProcessClearWorkerNode(), CNetStorageHandler::x_ProcessCreate(), CNetScheduleHandler::x_ProcessGetJob(), CNetScheduleHandler::x_ProcessJobExchange(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessReading(), CNetStorageHandler::x_ProcessReconfigure(), CNetScheduleHandler::x_ProcessReloadConfig(), CNetStorageHandler::x_ProcessRelocate(), CNetScheduleHandler::x_ProcessSetAffinity(), CNetScheduleHandler::x_ProcessSetQueue(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), CNetStorageGCApp::x_RemoveObjects(), CInstancedAligner::x_RunAligner(), CFastCgiApplicationMT::x_RunFastCGI(), SWorkerNodeJobContextImpl::x_RunJob(), SOfflineJobContextImpl::x_RunJob(), SDiagMessage::x_SaveContextData(), CId2ReaderBase::x_SetContextData(), CSparseGraph::x_Sync(), CNcbiApplicationAPI::x_TryMain(), CRequestContext::x_UpdateSubHitID(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
EDiagSev GetDiagDieLevel | ( | void | ) |
Get the "die" (abort) level for the program.
Definition at line 6211 of file ncbidiag.cpp.
Referenced by CAsyncDiagHandler::Post().
CDiagErrCodeInfo* GetDiagErrCodeInfo | ( | bool | take_ownership = false | ) |
Get handler for processing error codes.
Definition at line 7659 of file ncbidiag.cpp.
References _ASSERT, and CDiagLock::eRead.
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
string GetDiagFilter | ( | EDiagFilter | what | ) |
Get current diagnostic filter.
what | Filter is set for, only eDiagFilter_Trace and eDiagFilter_Post values are allowed, otherwise the function returns empty string. |
Definition at line 7681 of file ncbidiag.cpp.
References eDiagFilter_Post, eDiagFilter_Trace, CDiagLock::eWrite, kEmptyStr, s_PostFilter, and s_TraceFilter.
Referenced by CCdregionValidator::x_ValidateCDSPeptides().
CDiagHandler* GetDiagHandler | ( | bool | take_ownership = false , |
bool * | current_ownership = 0 |
||
) |
Get the currently set diagnostic handler class.
Definition at line 6329 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().
EDiagSev GetDiagPostLevel | ( | void | ) |
Get current threshold severity for posting the messages.
Definition at line 6151 of file ncbidiag.cpp.
Referenced by CPubseqGatewayApp::Init(), CPubseqGatewayApp::ParseArgs(), and CRPCClient_Base::x_Ask().
Uint8 GetDiagRequestId | ( | void | ) |
Get iteration number/request ID.
Definition at line 1195 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetRequestContext(), and CRequestContext::GetRequestID().
Referenced by GetFastCGIIteration().
CNcbiOstream* GetDiagStream | ( | void | ) |
Get current diagnostic stream (if it was set by SetDiagStream) or NULL.
Definition at line 8108 of file ncbidiag.cpp.
References eDiagFile_Err, GetDiagHandler(), CFileDiagHandler::GetLogStream(), and CStreamDiagHandler_Base::GetStream().
bool GetDiagTrace | ( | void | ) |
Check if traces are enabled.
Definition at line 6240 of file ncbidiag.cpp.
Referenced by CPubseqGatewayApp::Init().
Definition at line 798 of file request_ctx.hpp.
References CRequestContext::eProp_Dtab, kEmptyStr, CRequestContext::m_Dtab, and CRequestContext::x_IsSetProp().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), s_GetRequestDTab(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Get total elapsed time (including any adjustments) in seconds.
Definition at line 461 of file perf_log.hpp.
References CStopWatch::Elapsed(), CStopWatch::eStart, GetFastLocalTime(), CPerfLogger::m_Adjustment, CPerfLogger::m_Elapsed, CPerfLogger::m_LastStartTime, CPerfLogger::m_StopWatch, and CPerfLogger::m_TimerState.
Get URL-encoded application name.
Definition at line 1875 of file ncbidiag.cpp.
References CDiagContext::GetAppName(), CDiagContext::m_AppName, and CDiagContext::m_AppNameSet.
Referenced by SDiagMessage::GetAppName(), and SDiagMessage::x_SaveContextData().
URL-encoded version of GetHost()
Definition at line 1812 of file ncbidiag.cpp.
References CDiagContext::GetHost(), CDiagContext::m_Host, and CDiagContext::m_HostIP.
Referenced by SDiagMessage::GetHost(), and SDiagMessage::x_SaveContextData().
Get URL-encoded hostname.
Definition at line 1832 of file ncbidiag.cpp.
References CDiagContext::m_Host.
string CDiagContext::GetEncodedSessionID | ( | void | ) | const |
Get url-encoded session id.
Definition at line 874 of file logging.cpp.
References kEmptyStr.
Referenced by CRequestContext::GetEncodedSessionID(), SDiagMessage::GetSession(), and SDiagMessage::x_SaveContextData().
|
inline |
Get URL-encoded session ID.
Definition at line 714 of file request_ctx.hpp.
References CRequestContext::eProp_SessionID, GetDiagContext(), CDiagContext::GetEncodedSessionID(), CEncodedString::GetEncodedString(), CRequestContext::m_SessionID, and CRequestContext::x_IsSetProp().
|
overridevirtual |
Translate from the error code value to its string representation.
Definition at line 891 of file request_ctx.cpp.
References CRequestContextException::eBadHit, CRequestContextException::eBadSession, and CException::GetErrCodeString().
int CNcbiDiag::GetErrorCode | ( | void | ) | const |
Get error code of the current message.
Referenced by CDiagFilter::Check().
int CNcbiDiag::GetErrorSubCode | ( | void | ) | const |
Get error subcode of the current message.
Referenced by CDiagFilter::Check().
|
static |
Definition at line 5315 of file ncbidiag.cpp.
References SDiagMessage::eEvent_Extra, SDiagMessage::eEvent_PerfLog, SDiagMessage::eEvent_RequestStart, SDiagMessage::eEvent_RequestStop, SDiagMessage::eEvent_Start, SDiagMessage::eEvent_Stop, and kEmptyStr.
Referenced by SDiagMessage::ParseMessage(), and SDiagMessage::x_NewWrite().
|
inline |
Get exit code.
Definition at line 2174 of file ncbidiag.hpp.
References CDiagContext::m_ExitCode.
Referenced by CDiagContext::x_PrintMessage().
|
inline |
Get exit signal.
Definition at line 2183 of file ncbidiag.hpp.
References CDiagContext::m_ExitSig.
Referenced by CDiagContext::x_PrintMessage().
|
inline |
Definition at line 1410 of file ncbidiag.hpp.
References GetDiagRequestId().
const char* CDiagCompileInfo::GetFile | ( | void | ) | const |
const char* CNcbiDiag::GetFile | ( | void | ) | const |
Get file used for the current message.
Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().
const char* CNcbiDiag::GetFunction | ( | void | ) | const |
Get function name of the current message.
Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().
EDiagAppState CDiagContext::GetGlobalAppState | ( | void | ) | const |
Always returns global application state.
Definition at line 2796 of file ncbidiag.cpp.
References CDiagContext::m_AppState.
Referenced by CRequestContext::GetAppState().
|
inline |
Deprecated version of HID generator.
Definition at line 1997 of file ncbidiag.hpp.
References CDiagContext::GetNextHitID().
Get hit id value.
Definition at line 91 of file request_ctx.hpp.
References CSharedHitId::m_HitId.
Referenced by CDiagContext::GetDefaultHitID(), CRequestContext::SetHitID(), CRequestContext::x_GetHitID(), CRequestContext::x_LogHitID(), CRequestContext::x_SetHitID(), and CSharedHitId::x_SetHitId().
|
inline |
Get explicit hit id or the default one (from HTTP_NCBI_PHID etc).
If none of the above is available, generate a new id for the current request. If using the default hit id, it is cached in the request context and becomes local one.
Definition at line 227 of file request_ctx.hpp.
References CDiagContext::eHitID_Create, and CRequestContext::x_GetHitID().
Referenced by g_PostPerf(), CHTMLPageStat::PrintBegin(), s_UpdateVDBRequestContext(), CCgiApplication::x_OnEvent(), and CRequestContext::x_UpdateSubHitID().
Access to strings stored in SDiagMessageData.
Definition at line 5968 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetEncodedHost(), SDiagMessage::m_Data, and SDiagMessageData::m_Host.
Referenced by CDiagContext::WriteStdPrefix().
Get host name.
The order is: cached hostname, cached hostIP, uname or COMPUTERNAME, SERVER_ADDR, empty string.
Definition at line 1766 of file ncbidiag.cpp.
References _T_STDSTRING, _TX, buf, CDiagContext::m_Host, CDiagContext::m_HostIP, and NcbiSys_getenv.
Referenced by CDiagContext::GetEncodedHost(), SNetScheduleAPIImpl::Init(), CJaegerTracer::OnRequestStart(), CGridCommandLineInterfaceApp::SetUp_NetStorageCmd(), and CDiagContext::x_CreateUID().
Get host IP address.
Definition at line 2160 of file ncbidiag.hpp.
References CDiagContext::m_HostIP.
Referenced by CDiagContext::GetProperty().
Get host location (be-md/st-va) from /etc/ncbi/location.
Definition at line 3111 of file ncbidiag.cpp.
References _T_CSTRING, _TX, CDiagLock::eWrite, NcbiSys_getenv, s_HostLocation, s_ReadString(), and string.
Referenced by CDiagContext_Extra::PrintNcbiRoleAndLocation().
Get cached hostname - do not try to detect host name as GetHost() does.
Definition at line 1826 of file ncbidiag.cpp.
References CDiagContext::m_Host.
Referenced by CDiagContext::GetProperty().
Get host role (DEV/QA/TRY/PROD) from /etc/ncbi/role.
Definition at line 3091 of file ncbidiag.cpp.
References _T_CSTRING, _TX, CDiagLock::eWrite, NcbiSys_getenv, s_HostRole, s_ReadString(), and string.
Referenced by CNetStorageObjectLoc::Create(), SFileTrackConfig::SSite::operator TValue(), and CDiagContext_Extra::PrintNcbiRoleAndLocation().
int CDiagCompileInfo::GetLine | ( | void | ) | const |
size_t CNcbiDiag::GetLine | ( | void | ) | const |
Get line number for the current message.
Referenced by SThreadsInSTBuild::Report().
string GetLogFile | ( | EDiagFileType | file_type | ) |
Get log file name for the given log type.
Return empty string for eDiagFile_All or if the log file handler is not installed.
Definition at line 7612 of file ncbidiag.cpp.
References file_type, GetDiagHandler(), CFileDiagHandler::GetLogFile(), CStreamDiagHandler_Base::GetLogName(), and kEmptyStr.
Referenced by CProjBulderApp::Init(), and CDiagContext::IsUsingRootLog().
string CFileDiagHandler::GetLogFile | ( | EDiagFileType | file_type | ) | const |
Get current log file name.
If file_type is eDiagFile_All, always returns empty string.
Definition at line 6975 of file ncbidiag.cpp.
References eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, file_type, CStreamDiagHandler_Base::GetLogName(), kEmptyStr, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_Perf, and CFileDiagHandler::m_Trace.
Referenced by GetLogFile().
string GetLogFile | ( | void | ) |
Get log file name or diag handler name.
Definition at line 7629 of file ncbidiag.cpp.
References GetDiagHandler(), and kEmptyStr.
|
inline |
Access logger directly.
Definition at line 331 of file perf_log.hpp.
References CPerfLogGuard::m_Logger.
Get the logger's start time.
Definition at line 166 of file perf_log.hpp.
References CPerfLogger::m_FirstStartTime.
|
virtual |
Get current diag posts destination.
Reimplemented in CTeeDiagHandler, CSysLog, CAsyncDiagHandler, and CStreamDiagHandler_Base.
Definition at line 6375 of file ncbidiag.cpp.
References kLogName_Unknown, and string.
Referenced by CAsyncDiagHandler::GetLogName(), CTeeDiagHandler::GetLogName(), CDiagHandler::PostToConsole(), SetDiagHandler(), and CDiagContext::SetupDiag().
|
virtual |
Get current diag posts destination.
Reimplemented from CDiagHandler.
Definition at line 6408 of file ncbidiag.cpp.
References CStreamDiagHandler_Base::m_LogName.
Referenced by GetLogFile(), CFileDiagHandler::GetLogFile(), and CFileHandleDiagHandler::Reopen().
|
virtual |
Get current diag posts destination.
Reimplemented from CDiagHandler.
Definition at line 7255 of file ncbidiag.cpp.
References CDiagHandler::GetLogName(), CAsyncDiagHandler::m_AsyncThread, and CAsyncDiagThread::m_SubHandler.
|
inlinevirtual |
Get current diag posts destination.
Reimplemented from CDiagHandler.
Definition at line 111 of file syslog.hpp.
References CSysLog::kLogName_Syslog.
unsigned int CDiagContext::GetLogRate_Limit | ( | ELogRate_Type | type | ) | const |
Logging rate control - max number of messages per period.
Definition at line 1367 of file ncbidiag.cpp.
References CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, s_AppLogRateLimit, s_ErrLogRateLimit, and s_TraceLogRateLimit.
Referenced by CDiagContext::ResetLogRates(), and CDiagContext::SetLogRate_Period().
unsigned int CDiagContext::GetLogRate_Period | ( | ELogRate_Type | type | ) | const |
Logging rate control - the messages control period, seconds.
Definition at line 1421 of file ncbidiag.cpp.
References CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, s_AppLogRatePeriod, s_ErrLogRatePeriod, and s_TraceLogRatePeriod.
Referenced by CDiagContext::ResetLogRates(), and CDiagContext::SetLogRate_Limit().
CNcbiOstream * CFileDiagHandler::GetLogStream | ( | EDiagFileType | file_type | ) |
Get current log stream.
Return NULL if the selected destination is not a stream.
Definition at line 6993 of file ncbidiag.cpp.
References eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, file_type, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_Perf, and CFileDiagHandler::m_Trace.
Referenced by GetDiagStream().
|
static |
Get log file truncation flag.
Definition at line 3469 of file ncbidiag.cpp.
Referenced by CFileHandleDiagHandler::CFileHandleDiagHandler(), and CDiagContext::SetupDiag().
const char* CDiagCompileInfo::GetModule | ( | void | ) | const |
const char* CNcbiDiag::GetModule | ( | void | ) | const |
Get module name of the current message.
Referenced by CDiagFilter::Check(), and SThreadsInSTBuild::Report().
string CDiagContext::GetNextHitID | ( | void | ) | const |
Create global unique request id.
Definition at line 1715 of file ncbidiag.cpp.
References CDiagContext::x_GetNextHitID().
Referenced by CDiagContext::GetGlobalRequestId().
|
static |
Return the next available application-wide request ID.
Definition at line 190 of file request_ctx.cpp.
References CAtomicCounter::Add().
Referenced by s_AddLogPrefix(), and CRequestContext::SetRequestID().
|
inline |
Get current hit id appended with auto-incremented sub-hit id.
Definition at line 774 of file request_ctx.hpp.
References CRequestContext::m_SubHitIDCache, prefix, CRequestContext::x_CanModify(), and CRequestContext::x_UpdateSubHitID().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), g_AppendHitID(), SNetStorageRPC::MkStdRequest(), s_GetRequestID(), CCgiResponse::WriteHeader(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Get next sub-hit id value.
Definition at line 111 of file request_ctx.hpp.
References CSharedHitId::IsShared(), CSharedHitId::m_SharedSubHitId, and CSharedHitId::m_SubHitId.
Referenced by CRequestContext::x_UpdateSubHitID().
|
inline |
Definition at line 1199 of file ncbidiag.hpp.
References CNcbiDiag::m_OmitStackTrace.
|
static |
Get cached PID (read real PID if not cached yet).
Definition at line 1526 of file ncbidiag.cpp.
References CCurrentProcess::GetPid(), and CDiagContext::sm_PID.
Referenced by CGridCommandLineInterfaceApp::Cmd_Login(), SNetScheduleAPIImpl::Init(), CPubseqGatewayApp::OnInfo(), CJaegerTracer::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().
TDiagPostFlags CNcbiDiag::GetPostFlags | ( | void | ) | const |
Get post flags for the current message.
If the post flags have "eDPF_Default" set, then in the returned flags it will be reset and substituted by current default flags.
Referenced by SThreadsInSTBuild::Report(), and CNcbiDiag::x_Put().
|
inline |
Get current print severity.
Definition at line 1343 of file ncbidiag.hpp.
References CDiagCollectGuard::m_PrintSev.
Referenced by CDiagCollectGuard::x_Init(), and CNcbiDiag::x_Put().
|
static |
Return process post number (incrementing depends on the flag).
Definition at line 3848 of file ncbidiag.cpp.
References CAtomicCounter::Add(), ePostNumber_Increment, and CAtomicCounter::Get().
Referenced by SDiagMessage::SDiagMessage(), and SetDiagHandler().
|
inline |
Get all properties (non-const)
Definition at line 301 of file request_ctx.hpp.
References CRequestContext::m_Properties.
|
inline |
Get all properties (read only)
Definition at line 299 of file request_ctx.hpp.
References CRequestContext::m_Properties.
Get property value or empty string.
Definition at line 295 of file request_ctx.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), kEmptyStr, and CRequestContext::m_Properties.
Referenced by s_GetNextLogPrefix(), and s_GetReferer().
string CDiagContext::GetProperty | ( | const string & | name, |
EPropertyMode | mode = eProp_Default |
||
) | const |
Get application context property by name, return empty string if the property is not set.
If mode is eProp_Default and the property is not a known one, check thread-local properties first.
Definition at line 2018 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().
|
inline |
Get current read-only flag.
Definition at line 374 of file request_ctx.hpp.
References CRequestContext::m_IsReadOnly.
Referenced by CDiagContextThreadData::SetRequestContext().
Some compilers (e.g.
GCC 3.4.0) fail to use temporary objects as function arguments if there's no public copy constructor. Rather than using the temporary, get a reference from this method.
Definition at line 946 of file ncbidiag.hpp.
Referenced by CArrayHolder::Convert(), CMessageHandlerDiagPost::HandleMessage(), CMessageHandlerThrowOnError::HandleMessage(), CMessageListenerWithLog::PutError(), ReportIncorrectOrder(), ReportUnsafeStaticType(), and s_TraceParams().
|
inline |
Get the guarded request context.
Definition at line 598 of file request_ctx.hpp.
References CRequestContextGuard_Base::m_RequestContext.
|
static |
Shortcut to CDiagContextThreadData::GetThreadData().GetRequestContext()
Definition at line 1901 of file ncbidiag.cpp.
References CDiagContextThreadData::GetRequestContext(), and CDiagContextThreadData::GetThreadData().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), SNetScheduleSubmitterImpl::AppendClientIPSessionIDHitID(), SNetCacheAPIImpl::AppendClientIPSessionIDHitID(), SNetCacheAPIImpl::AppendClientIPSessionIDPasswordAgeHitID(), CNcbiTestsObserver::assertion_result(), SNSCommandArguments::AssignValues(), CGRPCServerCallbacks::BeginRequest(), NAutomation::CAutomationProc::ExecSetContext(), g_AppendClientIPSessionIDHitID(), g_PostPerf(), CDiagContext::GetAppState(), SDiagMessage::GetClient(), CPSG_Request::GetCtx(), GetDiagRequestId(), CDiagContext::GetProperty(), CDiagContext::GetSessionID(), CAsyncWriteCache::GetWriteStream(), SErrorEmulatorParameter::IsActive(), main(), SNetStorageRPC::MkStdRequest(), CCgiRequestProcessor::OnException(), CHTMLPageStat::PrintBegin(), CDiagContext::PrintStop(), CCgiApplication::ProcessHttpReferer(), SPSG_IoSession::ProcessRequest(), CCgiContext::RetrieveTrackingId(), SGridWorkerNodeImpl::Run(), CThread::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), s_GetNextLogPrefix(), s_GetReferer(), s_GetRequestDTab(), s_GetRequestID(), s_UpdateVDBRequestContext(), CGraphCache< TData >::SaveData(), CDiagContext::SetAppState(), SetDiagRequestId(), CCgiApplication::SetHTTPStatus(), CCgiRequestProcessor::SetHTTPStatus(), CDiagContext::SetProperty(), CPSGS_Request::SetRequestContext(), SetSessionAndIPAndPHID(), CCgiResponse::SetStatus(), CNetCacheAdmin::ShutdownServer(), SInteractiveNewRequestStart::SInteractiveNewRequestStart(), CCgiResponse::WriteHeader(), CCgiRequest::x_InitRequestContext(), CCgiContext::x_InitSession(), CNetScheduleHandler::x_LogCommandWithJob(), CNetScheduleHandler::x_OnCmdParserError(), CCgiApplication::x_OnEvent(), CNetScheduleHandler::x_PrintCmdRequestStart(), CDiagContext::x_PrintMessage(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), CNetStorageGCApp::x_RemoveObjects(), SDiagMessage::x_SaveContextData(), CCgiRequest::x_SetClientIpProperty(), CId2ReaderBase::x_SetContextData(), and CDiagContext::x_StartRequest().
|
inline |
Get request ID (or zero if not set).
Definition at line 634 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().
|
inline |
Request exit status.
Definition at line 822 of file request_ctx.hpp.
References CRequestContext::eProp_ReqStatus, CRequestContext::m_ReqStatus, and CRequestContext::x_IsSetProp().
Referenced by CCgiResponse::WriteHeader(), CNCMessageHandler::x_CleanCmdResources(), CNCMessageHandler::x_CloseCmdAndConn(), CNCMessageHandler::x_FinishCommand(), CNetScheduleHandler::x_HandleSocketErrorOnResponse(), CNetStorageHandler::x_OnSocketWriteError(), and CNCMessageHandler::x_WriteHttpResponse().
|
inline |
Definition at line 269 of file request_ctx.hpp.
References CRequestContext::m_ReqTimer.
|
inline |
Request execution timer.
Definition at line 268 of file request_ctx.hpp.
References CRequestContext::m_ReqTimer.
Referenced by CDiagContext::GetProperty(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), and CRequestContext::StartRequest().
string SDiagMessage::GetSession | ( | void | ) | const |
Definition at line 5984 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetEncodedSessionID(), SDiagMessage::m_Data, and SDiagMessageData::m_Session.
Referenced by CDiagContext::WriteStdPrefix().
string CDiagContext::GetSessionID | ( | void | ) | const |
Get the effective session id: the per-request session id if set, or the default session id.
Definition at line 2903 of file ncbidiag.cpp.
References CDiagContext::GetDefaultSessionID(), CDiagContext::GetRequestContext(), CRequestContext::GetSessionID(), and CRequestContext::IsSetExplicitSessionID().
Referenced by CDiagContext::GetProperty().
|
inline |
Session ID.
Definition at line 703 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(), COSGFetch::SetContext(), CNCActiveHandler::x_SendCopyPutCmd(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
EDiagSev CNcbiDiag::GetSeverity | ( | void | ) | const |
Get severity of the current message.
Referenced by CDiagFilter::Check(), CNcbiDiag::CheckFilters(), and CNcbiDiag::x_Put().
|
inline |
Get current severity cap for use in ePrintCapped mode.
Definition at line 1355 of file ncbidiag.hpp.
References CDiagCollectGuard::m_SeverityCap.
Referenced by CDiagContextThreadData::RemoveCollectGuard().
|
inline |
Definition at line 58 of file jaeger_tracer.hpp.
References CJaegerTracerSpan::m_Span.
Referenced by CJaegerTracer::OnRequestStop().
bool GetSplitLogFile | ( | void | ) |
|
inline |
Get the lowest thread-local post number in this guard's scope.
Definition at line 1365 of file ncbidiag.hpp.
References CDiagCollectGuard::m_StartingPoint.
Referenced by CDiagContextThreadData::RemoveCollectGuard().
Definition at line 45 of file request_status.cpp.
References CRequestStatus::e100_Continue, CRequestStatus::e101_SwitchingProtocols, CRequestStatus::e200_Ok, CRequestStatus::e201_Created, CRequestStatus::e202_Accepted, CRequestStatus::e203_NonAuthInformation, CRequestStatus::e204_NoContent, CRequestStatus::e205_ResetContent, CRequestStatus::e206_PartialContent, CRequestStatus::e299_PartialContentBrokenConnection, CRequestStatus::e300_MultipleChoices, CRequestStatus::e301_MovedPermanently, CRequestStatus::e302_Found, CRequestStatus::e303_SeeOther, CRequestStatus::e304_NotModified, CRequestStatus::e305_UseProxy, CRequestStatus::e307_TemporaryRedirect, CRequestStatus::e400_BadRequest, CRequestStatus::e401_Unauthorized, CRequestStatus::e402_PaymentRequired, CRequestStatus::e403_Forbidden, CRequestStatus::e404_NotFound, CRequestStatus::e405_MethodNotAllowed, CRequestStatus::e406_NotAcceptable, CRequestStatus::e407_ProxyAuthRequired, CRequestStatus::e408_RequestTimeout, CRequestStatus::e409_Conflict, CRequestStatus::e410_Gone, CRequestStatus::e411_LengthRequired, CRequestStatus::e412_PreconditionFailed, CRequestStatus::e413_RequestEntityTooLarge, CRequestStatus::e414_RequestURITooLong, CRequestStatus::e415_UnsupportedMediaType, CRequestStatus::e416_RangeNotSatisfiable, CRequestStatus::e417_ExpectationFailed, CRequestStatus::e422_UnprocessableEntity, CRequestStatus::e451_Unavailable_For_Legal_Reasons, CRequestStatus::e499_BrokenConnection, CRequestStatus::e500_InternalServerError, CRequestStatus::e501_NotImplemented, CRequestStatus::e502_BadGateway, CRequestStatus::e503_ServiceUnavailable, CRequestStatus::e504_GatewayTimeout, and CRequestStatus::e505_HTTPVerNotSupported.
Referenced by g_AsGRPCStatus(), CCgiException::GetStdStatusMessage(), and SPSG_IoSession::OnHeader().
|
inlinevirtual |
Reimplemented in CStreamDiagHandler.
Definition at line 2579 of file ncbidiag.hpp.
Referenced by GetDiagStream(), and IsDiagStream().
|
inlinevirtual |
Reimplemented from CStreamDiagHandler_Base.
Definition at line 2612 of file ncbidiag.hpp.
References CStreamDiagHandler::m_Stream.
Referenced by CNcbiApplicationAPI::AppMain().
void CDiagContext::GetStringUID | ( | TUID | uid, |
char * | buf | ||
) | const |
Definition at line 1685 of file ncbidiag.cpp.
References buf, and CDiagContext::GetStringUID().
void CDiagContext::GetStringUID | ( | TUID | uid, |
char * | buf, | ||
size_t | buf_len | ||
) | const |
Return string representation of UID.
If the argument UID is 0, use the one from the diag context.
Definition at line 1691 of file ncbidiag.cpp.
References buf, CDiagContext::GetUID(), and string.
Referenced by CDiagContext::GetStringUID(), SNetScheduleAPIImpl::Init(), CJaegerTracer::OnRequestStart(), s_GetOtherArgs(), CCgiResponse::SetMultipartMode(), CDiagContext::WriteStdPrefix(), CNetStorageHandler::x_GetConnRef(), and CNetScheduleHandler::x_GetConnRef().
|
static |
Return thread post number (incrementing depends on the flag).
Definition at line 3856 of file ncbidiag.cpp.
References CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::GetThreadPostNumber().
Referenced by CDiagCollectGuard::x_Init().
|
static |
Definition at line 3862 of file ncbidiag.cpp.
References CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::GetTID().
CTime SDiagMessage::GetTime | ( | void | ) | const |
Get time and date - current or parsed.
Definition at line 5341 of file ncbidiag.cpp.
References SDiagMessage::m_Data, SDiagMessageData::m_Time, and s_GetFastTime().
Referenced by CwxLogDiagHandler::Post(), and CDiagContext::WriteStdPrefix().
|
inline |
Definition at line 387 of file request_ctx.hpp.
References CRequestContext::m_TracerSpan.
CDiagContext::TUID SDiagMessage::GetUID | ( | void | ) | const |
Get UID from current context or parsed from a string.
Definition at line 5335 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetUID(), SDiagMessage::m_Data, and SDiagMessageData::m_UID.
Referenced by CDiagContext::WriteStdPrefix().
CDiagContext::TUID CDiagContext::GetUID | ( | void | ) | const |
Return (create if not created yet) unique diagnostic ID.
Definition at line 1664 of file ncbidiag.cpp.
References CDiagContext::m_UID, and CDiagContext::x_CreateUID().
Referenced by CNcbiApplicationAPI::CNcbiApplicationAPI(), CDiagContext::GetStringUID(), SDiagMessage::GetUID(), CJaegerTracer::OnRequestStart(), CDiagContext::UpdateUID(), CDiagContext::x_GetNextHitID(), and SDiagMessage::x_InitData().
Get username.
Definition at line 1754 of file ncbidiag.cpp.
References CDiagContext::m_Username.
Referenced by CDiagContext::GetProperty(), CGetStatisticsProcessor::Process(), and CGridCommandLineInterfaceApp::SetUp_NetStorageCmd().
|
inline |
Return version increased on every context change (hit/subhit id, client ip, session id).
Definition at line 380 of file request_ctx.hpp.
References CRequestContext::m_Version.
Referenced by s_UpdateVDBRequestContext().
Check if error description exists.
Return TRUE if description for specified error code exists, otherwise return FALSE.
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().
Ignore the die level settings.
Return previous setting.
WARNING!!! – not recommended for use unless you are real desperate: By passing TRUE to this function you can make your application never exit/abort regardless of the level set by SetDiagDieLevel(). But be warned this is usually a VERY BAD thing to do! – because any library code counts on at least "eDiag_Fatal" to exit unconditionally, and thus what happens once "eDiag_Fatal" has been posted, is, in general, totally unpredictable! Therefore, use it on your own risk.
Definition at line 6217 of file ncbidiag.cpp.
References CDiagLock::eWrite.
void CDiagContext::InitMessages | ( | size_t | max_size = 100 | ) |
Start collecting all messages (the collected messages can be flushed to a new destination later).
Stop collecting messages when max_size is reached.
Definition at line 3370 of file ncbidiag.cpp.
References CDiagContext::m_MaxMessages, and CDiagContext::m_Messages.
Referenced by CNcbiApplicationAPI::CNcbiApplicationAPI().
void CAsyncDiagHandler::InstallToDiag | ( | void | ) |
Install this DiagHandler into diagnostics.
Method should be called only when diagnostics is completely initialized, i.e. no earlier than CNcbiApplication::Run() is called. Method can throw CThreadException if dedicated thread failed to start.
Definition at line 7225 of file ncbidiag.cpp.
References CObject::AddReference(), GetDiagHandler(), CAsyncDiagHandler::m_AsyncThread, CAsyncDiagThread::m_SubHandler, CAsyncDiagHandler::m_ThreadSuffix, NULL, CObject::RemoveReference(), CThread::Run(), and SetDiagHandler().
When using applog, the diag post level is locked to Warning.
The following functions allow to access the lock, but should not be used by most applications.
Definition at line 2296 of file ncbidiag.hpp.
References CDiagContext::sm_ApplogSeverityLocked.
Referenced by AdjustApplogPrintableSeverity(), CDiagRestorer::CDiagRestorer(), and s_GetFastTime().
|
inline |
Check if message collecting is on.
Definition at line 2243 of file ncbidiag.hpp.
References CDiagContext::m_Messages.
bool IsDiagStream | ( | const CNcbiOstream * | os | ) |
Definition at line 7636 of file ncbidiag.cpp.
References CStreamDiagHandler_Base::GetStream().
|
static |
Definition at line 912 of file ncbidiag.cpp.
References eInitialized, CThread::IsMain(), and s_ThreadDataState().
|
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().
|
inline |
Check if this hit ID was set at request level.
Definition at line 117 of file request_ctx.hpp.
References eDiagAppState_Request, eDiagAppState_RequestBegin, eDiagAppState_RequestEnd, and CSharedHitId::m_AppState.
Referenced by CRequestContext::IsSetHitID().
|
inlineprivate |
Definition at line 406 of file request_ctx.hpp.
References CRequestContext::m_IsRunning.
|
inline |
Check if the property is set.
Definition at line 979 of file request_ctx.hpp.
References CRequestContext_PassThrough::m_Context, and CRequestContext::x_IsSetPassThroughProp().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata().
|
inline |
Definition at line 872 of file request_ctx.hpp.
References CRequestContext::eProp_BytesRd, and CRequestContext::x_IsSetProp().
|
inline |
Definition at line 901 of file request_ctx.hpp.
References CRequestContext::eProp_BytesWr, and CRequestContext::x_IsSetProp().
|
inline |
Definition at line 680 of file request_ctx.hpp.
References CDiagContext::GetDefaultClientIP(), GetDiagContext(), and CRequestContext::IsSetExplicitClientIP().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), SNetCacheAPIImpl::AppendClientIPSessionID(), g_AppendClientIPAndSessionID(), SNetStorageRPC::MkStdRequest(), s_UpdateVDBRequestContext(), COSGFetch::SetContext(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
bool IsSetDiagErrCodeInfo | ( | ) |
Indicates whether an error-code processing handler has been set.
Definition at line 7654 of file ncbidiag.cpp.
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
bool IsSetDiagHandler | ( | void | ) |
Check if diagnostic handler is set.
Definition at line 6324 of file ncbidiag.cpp.
References s_DefaultHandler.
|
inline |
Check if a specified flag is set.
flag | Flag to check |
flags | If eDPF_Default is set for "flags" then use the current global flags on its place (merged with other flags from "flags"). |
Referenced by CDiagContext::ApproveMessage(), CNcbiDiag::ForceImportantFlags(), CFileDiagHandler::x_GetDiagFileType(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
inline |
Dtab.
Definition at line 791 of file request_ctx.hpp.
References CRequestContext::eProp_Dtab, and CRequestContext::x_IsSetProp().
Referenced by CCgiRequest::x_InitRequestContext(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Check if exit code has been set.
Definition at line 2172 of file ncbidiag.hpp.
References CDiagContext::m_ExitCodeSet.
Referenced by CNcbiApplicationAPI::AppMain().
|
inline |
Definition at line 687 of file request_ctx.hpp.
References CRequestContext::eProp_ClientIP, and CRequestContext::x_IsSetProp().
Referenced by CRequestContext::IsSetClientIP().
|
inline |
Check if there's an explicit hit id.
Definition at line 242 of file request_ctx.hpp.
References CRequestContext::eHitID_Request, and CRequestContext::IsSetHitID().
|
inline |
Does not check default SID.
Definition at line 729 of file request_ctx.hpp.
References CRequestContext::eProp_SessionID, and CRequestContext::x_IsSetProp().
Referenced by CDiagContext::GetSessionID(), and CRequestContext::IsSetSessionID().
|
inline |
Check if there's an explicit hit id or the default one.
src | Allowed source(s) of hit id. |
Definition at line 745 of file request_ctx.hpp.
References CRequestContext::eHitID_Any, CRequestContext::eHitID_Default, CRequestContext::eHitID_Request, CRequestContext::eProp_HitID, GetDiagContext(), CSharedHitId::IsRequestLevel(), CRequestContext::m_HitID, and CRequestContext::x_IsSetProp().
Referenced by g_PostPerf(), CRequestContext::IsSetExplicitHitID(), s_UpdateVDBRequestContext(), COSGFetch::SetContext(), CCgiRequest::x_InitRequestContext(), CId2ReaderBase::x_SetContextData(), CRequestContext::x_UpdateStdPassThroughProp(), and CRequestContext::x_UpdateSubHitID().
|
static |
Check old/new format flag (for compatibility only)
Definition at line 3346 of file ncbidiag.cpp.
References s_OldPostFormat.
Referenced by CCgiApplication::AppStart(), CNcbiApplicationAPI::AppStart(), CCgiApplication::ConfigureDiagFormat(), CDiagContext_Extra::Flush(), init_common(), CDiagContext::sx_ThreadDataTlsCleanup(), SDiagMessage::x_IsSetOldFormat(), CCgiApplication::x_OnEvent(), and CDiagContext::x_PrintMessage().
Check if the property has a value (even if it's an empty string).
Definition at line 302 of file request_ctx.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), and CRequestContext::m_Properties.
Referenced by CCgiRequest::x_InitRequestContext().
|
inline |
Check if request ID was assigned a value.
Definition at line 657 of file request_ctx.hpp.
References CRequestContext::eProp_RequestID, and CRequestContext::x_IsSetProp().
|
inline |
Definition at line 843 of file request_ctx.hpp.
References CRequestContext::eProp_ReqStatus, and CRequestContext::x_IsSetProp().
Referenced by CDiagContext::GetProperty(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
|
inline |
Definition at line 722 of file request_ctx.hpp.
References CDiagContext::GetDefaultSessionID(), GetDiagContext(), and CRequestContext::IsSetExplicitSessionID().
Referenced by CGRPCClientContext::AddStandardNCBIMetadata(), SNetStorageRPC::MkStdRequest(), CCgiContext::RetrieveTrackingId(), s_UpdateVDBRequestContext(), COSGFetch::SetContext(), CId2ReaderBase::x_SetContextData(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Check if shared counter is used.
Definition at line 88 of file request_ctx.hpp.
References CSharedHitId::m_SharedSubHitId.
Referenced by CSharedHitId::GetCurrentSubHitId(), CSharedHitId::GetNextSubHitId(), and CSharedHitId::SetShared().
|
static |
Check if the current diagnostics destination is /log/*.
Definition at line 3868 of file ncbidiag.cpp.
References GetLogFile(), and kRootLog.
|
static |
Check if system TID is printed instead of CThread::GetSelf()
Definition at line 3358 of file ncbidiag.cpp.
References s_PrintSystemTID.
Check if session id fits the allowed format.
Definition at line 479 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().
Check if the specified severity is higher or equal to the currently selected post level and will be printed by ERR_POST.
Definition at line 6166 of file ncbidiag.cpp.
References AdjustApplogPrintableSeverity(), CompareDiagPostLevel(), and eDiag_Trace.
Referenced by CDiagHandler::PostToConsole(), and s_LOG_Handler().
|
inline |
Log (as an extra) all names/values matching fields in NCBI_LOG_FIELDS.
If source passed to the constructor is not empty, all names are prefixed with 'source.' string.
Definition at line 2408 of file ncbidiag.hpp.
References entries, CDiagContext::Extra(), GetDiagContext(), and CNcbiLogFields::x_Match().
Referenced by CGRPCServerCallbacks::BeginRequest(), and CHttpRequest::PrintLogFields().
MDiagClass::MDiagClass | ( | const char * | nclass | ) |
MDiagFunction::MDiagFunction | ( | const char * | function | ) |
MDiagModule::MDiagModule | ( | const char * | module | ) |
CRequestContextException::NCBI_EXCEPTION_DEFAULT | ( | CRequestContextException | , |
CException | |||
) |
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.
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.
void NcbiLog_AppNewHitID | ( | void | ) |
Definition at line 3101 of file ncbi_c_log.c.
void NcbiLog_AppNewSession | ( | void | ) |
Auto-generate and then set brand-new application-wide session ID (SID).
Definition at line 3020 of file ncbi_c_log.c.
References MT_LOCK_API, MT_UNLOCK, NCBILOG_SESSION_MAX, s_GenerateSID_Str(), s_SetSession(), SInfo_tag::session, and sx_Info.
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().
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'.
client | New client name (IP address). It will be set to 'UNK_CLIENT' if parameter is NULL or empty string. |
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.
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.
hit_id | New (P)HID. (It will be URL-encoded.) (P)HID will be unset if the parameter is NULL or point to empty string, and PHID has not been logged yet. |
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.
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'.
session | New session ID. (It will be URL-encoded.) It will be set to 'UNK_SESSION' if the parameter is NULL or empty string. |
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().
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).
argc | The count of arguments that follow in argv (from main()). |
argv | An array of null-terminated strings representing command-line arguments of the program (from main()). |
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().
void NcbiLog_AppStop | ( | int | exit_status | ) |
Should be called immediately prior to the application exit.
Logs the 'stop' line to the <appname>.log files. Calculates the application runtime duration based on a start time recorded when the application starts up.
Definition at line 3400 of file ncbi_c_log.c.
References NcbiLogP_AppStop().
Referenced by main().
The same as NcbiLog_AppStop(), except it also accepts a signal number, if application exited due to a signal.
Definition at line 3406 of file ncbi_c_log.c.
References NcbiLogP_AppStop().
int NcbiLog_Context_Attach | ( | TNcbiLog_Context | ctx | ) |
Attach logging context object to the C Logging API.
ctx | A handle previously obtained from NcbiLog_Context_Create(). |
Definition at line 2655 of file ncbi_c_log.c.
References ctx, MT_LOCK_API, MT_UNLOCK, and s_AttachContext().
TNcbiLog_Context NcbiLog_Context_Create | ( | void | ) |
Create new thread-specific logging context object.
These context-specific methods to create, attach, detach and destroy thread-specific logging context objects allow to separate context from the API, store it somewhere else and use when necessary, even from different threads. Because the API initialization can be done in background, it is impossible to pass application name used in each logging message, so it will be "UNKNOWN" by default. But, you can call NcbiLog_Init() or NcbiLog_InitForAttachedContext(), or one of its variants. Or, you can hard-code application name on the compilation step, using "-D NCBI_C_LOG_APPNAME=appname" in the compiler's command line for this API.
Definition at line 2644 of file ncbi_c_log.c.
References ctx, NcbiLog_InitForAttachedContext(), NULL, and s_CreateContext().
void NcbiLog_Context_Destroy | ( | TNcbiLog_Context | ctx | ) |
Destroy context structure.
ctx | A handle previously obtained from NcbiLog_Context_Create(). |
Definition at line 2681 of file ncbi_c_log.c.
void NcbiLog_Context_Detach | ( | void | ) |
Detach logging context object from the C Logging API.
Definition at line 2668 of file ncbi_c_log.c.
References MT_LOCK_API, MT_UNLOCK, NULL, s_TlsSetValue(), sx_ContextST, and sx_TlsIsInit.
void NcbiLog_Critical | ( | const char * | msg | ) |
Writes a message to the <appname>.err log at level 'CRITICAL'.
Definition at line 3846 of file ncbi_c_log.c.
References eNcbiLog_Critical, and s_PrintMessage().
Referenced by main(), and CNcbiApplogApp::Run().
int NcbiLog_Default_MTLock_Handler | ( | void * | user_data, |
ENcbiLog_MTLock_Action | action | ||
) |
Default implementation of simple MT locking callback.
user_data | Simple default handler don't use this parameter; will be ignored. |
action | Operation that should be done in the callback handler. |
Definition at line 255 of file ncbi_c_log.c.
Referenced by NcbiLog_InitMT().
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().
void NcbiLog_Destroy_Thread | ( | void | ) |
Destroy thread-specific NcbiLog API information.
Each thread should call this function before termination, and before NcbiLog_Destroy() call. Calling any other API function in the current thread except NcbiLog_Destroy() is prohibited and can lead to application crash.
Definition at line 2594 of file ncbi_c_log.c.
References MT_LOCK, MT_UNLOCK, and s_DestroyContext().
void NcbiLog_Error | ( | const char * | msg | ) |
Writes a message to the <appname>.err log at level 'ERROR'.
Definition at line 3841 of file ncbi_c_log.c.
References eNcbiLog_Error, and s_PrintMessage().
Referenced by main(), and CNcbiApplogApp::Run().
void NcbiLog_Extra | ( | const SNcbiLog_Param * | params | ) |
Can be called at any time.
Writes the 'extra' line to the <appname>.log file. Can take a pointer to NULL-terminated array with parameters, as key/value pairs; that data will be logged. Appropriate for logging thing such as HTTP referrer information and cookie values. Should NOT be used for executing tracing or logging of debugging info – see the NcbiLog_Trace function for those purposes.
Definition at line 3716 of file ncbi_c_log.c.
References CHECK_APP_START, ctx, MT_LOCK_API, MT_UNLOCK, NULL, s_Extra(), and s_GetContext().
Referenced by main().
void NcbiLog_Fatal | ( | const char * | msg | ) |
Writes a message to the <appname>.err log at level 'FATAL' and then terminate the application.
Definition at line 3851 of file ncbi_c_log.c.
References eNcbiLog_Fatal, and s_PrintMessage().
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.
ptr | Pointer to allocated memory. |
Definition at line 3264 of file ncbi_c_log.c.
References free().
char* NcbiLog_GetCurrentSubHitID | ( | void | ) |
Definition at line 3212 of file ncbi_c_log.c.
References NcbiLog_GetCurrentSubHitID_Prefix(), and NULL.
char* NcbiLog_GetCurrentSubHitID_Prefix | ( | const char * | prefix | ) |
Get the last generated sub-hit ID.
prefix | Prefix for generated sub-hit ID string. Empty if NULL. |
Definition at line 3218 of file ncbi_c_log.c.
References ctx, eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, prefix, s_GetContext(), s_GetSubHitID(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.
Referenced by NcbiLog_GetCurrentSubHitID().
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.
const char* NcbiLog_GetHostLocation | ( | void | ) |
Get host location.
If $NCBI_LOCATION environment variable is defined, use its value. Otherwise, read it from /etc/ncbi/location
Get host location.
Definition at line 648 of file ncbi_c_log.c.
References location, NULL, s_ReadFileString(), and s_StrDup().
Referenced by NcbiLog_AppRun(), CNcbiApplogApp::Redirect(), and s_PrintReqStartExtraParams().
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().
const char* NcbiLog_GetHostRole | ( | void | ) |
Get host role.
If $NCBI_ROLE environment variable is defined, use its value. Otherwise, read it from /etc/ncbi/role.
Get host role.
Definition at line 630 of file ncbi_c_log.c.
References NULL, s_ReadFileString(), and s_StrDup().
Referenced by NcbiLog_AppRun(), CNcbiApplogApp::Redirect(), and s_PrintReqStartExtraParams().
char* NcbiLog_GetNextSubHitID | ( | void | ) |
Definition at line 3238 of file ncbi_c_log.c.
References NcbiLog_GetNextSubHitID_Prefix(), and NULL.
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.
prefix | Prefix for generated sub-hit ID string. Empty if NULL. |
Definition at line 3244 of file ncbi_c_log.c.
References ctx, eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, prefix, s_GetContext(), s_GetSubHitID(), SInfo_tag::state, sx_Info, and TROUBLE_MSG.
Referenced by NcbiLog_GetNextSubHitID().
TNcbiLog_Counter NcbiLog_GetRequestId | ( | void | ) |
Get current request ID (RID).
Definition at line 2913 of file ncbi_c_log.c.
References MT_LOCK_API, MT_UNLOCK, SInfo_tag::rid, and sx_Info.
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.
ENcbiLog_AppState NcbiLog_GetState | ( | void | ) |
Get current logging execution state (context and thread specific).
Definition at line 3283 of file ncbi_c_log.c.
References ctx, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, NULL, s_GetContext(), SInfo_tag::state, sx_Info, and sx_IsInit.
void NcbiLog_Info | ( | const char * | msg | ) |
Writes a message to the <appname>.trace file at level 'INFO'.
Note that the default log level is ERROR.
Definition at line 3831 of file ncbi_c_log.c.
References eNcbiLog_Info, and s_PrintMessage().
Referenced by CNcbiApplogApp::Run().
void NcbiLog_Init | ( | const char * | appname, |
TNcbiLog_MTLock | mt_lock, | ||
ENcbiLog_MTLock_Ownership | mt_lock_ownership | ||
) |
Initializing NcbiLog API.
This function should be called before any other API's function. Only first call of NcbiLog_Init() have effect. All subsequent calls will be ignored. Preferable, in MT applications it should be called before creating any child thread uses logging.
appname | Set the application name shown in logs and used for logfile names. By default the name is unknown. The application name can be set only once at API initialization (using NcbiLog_Init() call). This name could include path and extension, only base name will be used to show in logs. Also, any spaces contained in the base file name will be URL-encoded. Also, the application name can be hard-coded on the compilation step, using "-D NCBI_C_LOG_APPNAME=appname" in the compiler's command line for this API. Hard-coded name have a priority over the passed parameter. |
mt_lock | User defined MT lock. It is necessary to use NcbiLog API in multi-threaded applications. |
own_mt_lock | MT lock ownership flag. If eNcbiLog_MT_TakeOwnership is passed, then the MT lock handler will be destroyed in NcbiLog_Destroy(). |
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().
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.
appname | Set the application name shown in logs and used for logfile names. By default the name is unknown. The application name can be set only once at API initialization. This name could include path and extension, only base name will be used to show in logs. Also, any spaces contained in the base file name will be URL-encoded. Also, the application name can be hard-coded on the compilation step, using "-D NCBI_C_LOG_APPNAME=appname" in the compiler's command line for this API. Hard-coded name have a priority over passed parameter. |
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().
void NcbiLog_InitForAttachedContextST | ( | const char * | appname | ) |
Version of NcbiLog_InitForAttachedContext() intended to use in single-threaded applications.
Use it if you use API from single thread only, it can be a little bit faster than NcbiLog_InitForAttachedContext() because don't use MT-safety.
Definition at line 2588 of file ncbi_c_log.c.
References NcbiLog_InitST().
void NcbiLog_InitMT | ( | const char * | appname | ) |
Version of NcbiLog_Init with default MT lock implementation.
This function should be called before any other API's function. Preferable, in MT applications it should be called before creating any child thread uses logging.
Definition at line 2547 of file ncbi_c_log.c.
References eNcbiLog_MT_TakeOwnership, NcbiLog_Default_MTLock_Handler(), NcbiLog_Init(), NcbiLog_MTLock_Create(), and NULL.
Referenced by main().
void NcbiLog_InitST | ( | const char * | appname | ) |
Version of NcbiLog_Init to use in single-threaded applications.
This function should be called before any other API's function.
Definition at line 2554 of file ncbi_c_log.c.
References eNcbiLog_MT_NoOwnership, NcbiLog_Init(), and NULL.
Referenced by CNcbiApplogApp::Cmd_Health(), NcbiLog_InitForAttachedContextST(), and CNcbiApplogApp::Run().
TNcbiLog_MTLock NcbiLog_MTLock_Create | ( | void * | user_data, |
FNcbiLog_MTLock_Handler | handler | ||
) |
Create new MT lock.
user_data | Unspecified data to call "handler" with. Could be used to have the same handler for some different MT locks. The 'user_data' allow to distinguish each lock and adjust behavior accordingly. |
handler | Locking callback |
Definition at line 347 of file ncbi_c_log.c.
References TNcbiLog_MTLock_tag::handler, kMTLock_magic_number, TNcbiLog_MTLock_tag::magic_number, malloc(), and TNcbiLog_MTLock_tag::user_data.
Referenced by main(), and NcbiLog_InitMT().
void NcbiLog_MTLock_Delete | ( | TNcbiLog_MTLock | lock | ) |
Call cleanup action on the handler, then destroy it.
lock | A handle previously obtained from NcbiLog_MTLock_Create(). |
Definition at line 363 of file ncbi_c_log.c.
References free(), TNcbiLog_MTLock_tag::magic_number, MT_DESTROY, MT_LOCK_VALID, and NULL.
Referenced by NcbiLog_Destroy().
void NcbiLog_NewHitID | ( | void | ) |
Definition at line 3108 of file ncbi_c_log.c.
void NcbiLog_NewSession | ( | void | ) |
Auto-generate and then set brand-new session ID (SID) for the request.
Definition at line 3029 of file ncbi_c_log.c.
References ctx, MT_LOCK_API, MT_UNLOCK, NCBILOG_SESSION_MAX, NULL, s_GenerateSID_Str(), s_GetContext(), and s_SetSession().
void NcbiLog_Note | ( | ENcbiLog_Severity | sev, |
const char * | msg | ||
) |
Writes a message using "Note[X]" notation for severity.
Behavior is identical to NcbiLog_XXX() function for each severity.
Definition at line 3856 of file ncbi_c_log.c.
References s_PrintMessage().
Referenced by main(), and CNcbiApplogApp::Run().
void NcbiLog_Perf | ( | int | status, |
double | timespan, | ||
const SNcbiLog_Param * | params | ||
) |
Can be called at any time.
Writes the 'perf' line to the <appname>.log file. Used to log a performance information. Takes status code of some operation, its execution time and a pointer to NULL-terminated array with parameters, as key/value pairs.
Definition at line 3738 of file ncbi_c_log.c.
References buf, CATCH, CHECK_APP_START, ctx, eDiag_Perf, SInfo_tag::message, MT_LOCK_API, MT_UNLOCK, NCBILOG_ENTRY_MAX, NULL, SInfo_tag::phid, s_GetContext(), s_IsInsideRequest(), s_Post(), s_PrintCommonPrefix(), s_PrintParams(), s_PrintParamsPair(), sx_Info, and VERIFY_CATCH.
Referenced by main().
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().
void NcbiLog_ReqStart | ( | const SNcbiLog_Param * | params | ) |
Should be called once application startup is complete, before any request processing code is run.
Writes the 'request-start' line to the <appname>.log file. Sets or resets the start time of the current request; that data is later used by NcbiLog_ReqStop() to calculate the request runtime duration. Can optionally be passed a pointer to NULL-terminated array with parameters, as key/value pairs; that data will be logged. This method also resets the client and session information. If the user has provided alternate info, it may be overridden as a side-effect of calling this method. Automatically increase request id number.
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().
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().
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.
client | New client name (IP address). It will be set to 'UNK_CLIENT' if parameter is NULL or empty string. |
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().
ENcbiLog_Destination NcbiLog_SetDestination | ( | ENcbiLog_Destination | ds | ) |
Set up diagnostics destination.
ds | An enum value to specify an application's 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().
ENcbiLog_Destination NcbiLog_SetDestinationFile | ( | const char * | logfile_base | ) |
Variant of NcbiLog_SetDestination for logging to a specific file (eNcbiLog_File).
This is CLog/ncbi_applog specific, not a standard feature.
logfile_base | A base name for a log file(-es). If splitting is disabled, there will be a single <logfile_base>.log file, or some files with err/perf/trace extentions otherwise. |
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().
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().
hit_id | New (P)HID. (It will be URL-encoded.) (P)HID will be unset if the parameter is NULL or point to empty string. |
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().
void NcbiLog_SetHost | ( | const char * | host | ) |
Set the host name.
By default, this value is taken from the system.
host | New host name. It will be set to 'UNK_HOST' if parameter is NULL or empty string. |
Definition at line 2933 of file ncbi_c_log.c.
References MT_LOCK_API, MT_UNLOCK, and s_SetHost().
Referenced by CNcbiApplogApp::SetInfo().
ENcbiLog_Severity NcbiLog_SetPostLevel | ( | ENcbiLog_Severity | sev | ) |
Set new posting severity threshold.
All messages with severity lower than specified will be ignored.
Definition at line 3272 of file ncbi_c_log.c.
References MT_LOCK_API, MT_UNLOCK, SInfo_tag::post_level, prev(), and sx_Info.
Referenced by main(), and CNcbiApplogApp::Run().
void NcbiLog_SetProcessId | ( | TNcbiLog_PID | pid | ) |
Set process ID (PID).
Definition at line 2882 of file ncbi_c_log.c.
References MT_LOCK_API, MT_UNLOCK, SInfo_tag::pid, and sx_Info.
void NcbiLog_SetRequestId | ( | TNcbiLog_Counter | rid | ) |
Set current request ID (RID).
Calling this method before NcbiLog_AppRun() is not allowed.
Definition at line 2900 of file ncbi_c_log.c.
References eNcbiLog_AppBegin, eNcbiLog_NotSet, MT_LOCK_API, MT_UNLOCK, SInfo_tag::rid, SInfo_tag::state, sx_Info, and TROUBLE_MSG.
Referenced by main().
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.
session | New session ID. (It will be URL-encoded.) It will be set to 'UNK_SESSION' if the parameter is NULL or empty string. |
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().
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().
void NcbiLog_SetThreadId | ( | TNcbiLog_TID | tid | ) |
Set thread ID (TID).
Definition at line 2890 of file ncbi_c_log.c.
References ctx, MT_LOCK_API, MT_UNLOCK, NULL, and s_GetContext().
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.
timer | GMT date and time at which the message was posted (see time()). This time value will be converted to local date/time automatically. The current date/time will be used if this parameter is zero. |
nanoseconds | Nanosecond part of the time. |
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().
void NcbiLog_Trace | ( | const char * | msg | ) |
Writes a message to the <appname>.trace file at level 'TRACE'.
Note that the default log level is ERROR.
Definition at line 3826 of file ncbi_c_log.c.
References eNcbiLog_Trace, and s_PrintMessage().
Referenced by main(), and CNcbiApplogApp::Run().
void NcbiLog_UpdateOnFork | ( | TNcbiLog_OnForkFlags | flags | ) |
Update logging internal information after fork().
This function should be called immediatly after fork(), before any other NcbiLog_* functions, or you will get a wrong and unpredictable output, Updates PID if necessary (in the child process). If PID has not changed (parent process), no other actions are performed. Can do additional actions depending on flags.
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.
void NcbiLog_Warning | ( | const char * | msg | ) |
Writes a message to the <appname>.err log at level 'WARNING'.
Note that the default log level is ERROR.
Definition at line 3836 of file ncbi_c_log.c.
References eNcbiLog_Warning, and s_PrintMessage().
Referenced by main(), and CNcbiApplogApp::Run().
|
pure virtual |
Factory method interface.
Implemented in CEmailDiagFactory, CAsBodyDiagFactory, CStderrDiagFactory, and CCommentDiagFactory.
Referenced by CCgiApplication::ConfigureDiagDestination().
|
overridevirtual |
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().
|
pure virtual |
Implemented in CJaegerTracer.
|
overridevirtual |
Implements IRequestTracer.
Definition at line 197 of file jaeger_tracer.cpp.
References context, and CJaegerTracerSpan::GetSpan().
|
pure virtual |
Implemented in CJaegerTracer.
|
inlineprivate |
Private delete operator.
Prohibit dynamic deallocation (and allocation) because there's no good reason to allow it, and out-of-order destruction is problematic.
Definition at line 2962 of file ncbidiag.hpp.
|
inlineprivate |
Private delete[] operator.
Prohibit dynamic deallocation (and allocation) because there's no good reason to allow it, and out-of-order destruction is problematic.
Definition at line 2968 of file ncbidiag.hpp.
|
inlineprivate |
Private new operator.
Prohibit dynamic allocation because there's no good reason to allow it, and out-of-order destruction is problematic.
Definition at line 2950 of file ncbidiag.hpp.
|
inlineprivate |
Private new[] operator.
Prohibit dynamic allocation because there's no good reason to allow it, and out-of-order destruction is problematic.
Definition at line 2956 of file ncbidiag.hpp.
|
pure virtual |
|
inline |
Insert message in output stream.
Definition at line 1762 of file ncbidiag.hpp.
References SDiagMessage::Write().
Definition at line 1231 of file ncbidiag.hpp.
References CNcbiDiag::operator<<(), and CNcbiDiag::Put().
Post the arguments.
Definition at line 1024 of file ncbidiag.hpp.
References CNcbiDiag::Put().
const CNcbiDiag& CNcbiDiag::operator<< | ( | FIosbaseManip | manip | ) | const |
Definition at line 1015 of file ncbidiag.hpp.
Referenced by CNcbiDiag::operator<<().
|
private |
CDiagContext_Extra & CDiagContext_Extra::operator= | ( | const CDiagContext_Extra & | args | ) |
Definition at line 2419 of file ncbidiag.cpp.
References CDiagContext_Extra::m_AllowBadNames, CDiagContext_Extra::m_Args, CDiagContext_Extra::m_Counter, CDiagContext_Extra::m_Flushed, CDiagContext_Extra::m_PerfStatus, CDiagContext_Extra::m_PerfTime, CDiagContext_Extra::m_Typed, and CDiagContext_Extra::x_Release().
Private assignment operator to prohibit assignment.
|
private |
SDiagMessage & SDiagMessage::operator= | ( | const SDiagMessage & | message | ) |
Assignment of messages.
Definition at line 4613 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().
|
private |
Definition at line 1339 of file logging.cpp.
References CTempString::data(), CDiagCompileInfo::m_ClassName, CDiagCompileInfo::m_CurrFunctName, CDiagCompileInfo::m_FunctName, CDiagCompileInfo::m_Parsed, s_ParseFuncName(), and CTempString::size().
|
static |
Stream parser.
Reads messages from a stream and calls the callback for each message.
Definition at line 5233 of file ncbidiag.cpp.
References ERR_POST_X, Error(), i, in(), and SDiagMessage::SDiagMessage().
Parse the whole string into the message.
Return true on success, false if parsing failed.
Definition at line 4879 of file ncbidiag.cpp.
References eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, eDiag_Warning, eDiagAppState_AppRun, eDiagSevMin, eDPF_AppLog, eDPF_IsNote, SDiagMessage::eEvent_Extra, SDiagMessage::eEvent_PerfLog, SDiagMessage::eEvent_RequestStart, SDiagMessage::eEvent_RequestStop, SDiagMessage::eEvent_Start, SDiagMessage::eEvent_Stop, SDiagMessage::eFormat_Auto, SDiagMessage::eFormat_New, SDiagMessage::GetEventName(), kDiagTimeFormat, kDiagW_UID, kUnknown_App, kUnknown_Client, kUnknown_Host, kUnknown_Session, SDiagMessageData::m_AppName, SDiagMessageData::m_AppState, SDiagMessage::m_Buffer, SDiagMessage::m_BufferLen, SDiagMessage::m_Class, SDiagMessageData::m_Class, SDiagMessageData::m_Client, SDiagMessage::m_Data, SDiagMessage::m_ErrCode, SDiagMessage::m_ErrSubCode, SDiagMessage::m_ErrText, SDiagMessageData::m_ErrText, SDiagMessage::m_Event, SDiagMessage::m_File, SDiagMessageData::m_File, SDiagMessage::m_Flags, SDiagMessage::m_Format, SDiagMessage::m_Function, SDiagMessageData::m_Function, SDiagMessageData::m_Host, SDiagMessage::m_Line, SDiagMessageData::m_Message, SDiagMessage::m_Module, SDiagMessageData::m_Module, SDiagMessage::m_PID, SDiagMessage::m_Prefix, SDiagMessage::m_ProcPost, SDiagMessage::m_RequestId, SDiagMessageData::m_Session, SDiagMessage::m_Severity, SDiagMessage::m_ThrPost, SDiagMessage::m_TID, SDiagMessageData::m_Time, SDiagMessage::m_TypedExtra, SDiagMessageData::m_UID, NPOS, s_ParseInt(), s_ParseStr(), s_StrToAppState(), string, NStr::StringToInt(), NStr::StringToUInt8(), CNcbiDiag::StrToSeverityLevel(), tmp, and SDiagMessage::x_ParseExtraArgs().
Referenced by SDiagMessage::SDiagMessage().
void PopDiagPostPrefix | ( | void | ) |
Pop a string from the list of message prefixes.
Definition at line 6119 of file ncbidiag.cpp.
References buf, and GetDiagBuffer().
Referenced by CDiagAutoPrefix::~CDiagAutoPrefix().
|
virtual |
Post message to the handler.
Implements CDiagHandler.
Definition at line 6434 of file ncbidiag.cpp.
References CDiagLock::ePost, CStreamDiagHandler::m_QuickFlush, CStreamDiagHandler::m_Stream, NcbiFlush, and str().
|
virtual |
Post message to the handler.
Implements CDiagHandler.
Definition at line 6611 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().
|
virtual |
Post message to the handler.
Info and Trace messages are sent to file_name.trace file, all others go to file_name.err file. Application access messages go to file_name.log file.
Implements CDiagHandler.
Definition at line 7100 of file ncbidiag.cpp.
References CStopWatch::Elapsed(), CDiagLock::ePost, CDiagHandler::fDefault, CStopWatch::IsRunning(), kLogReopenDelay, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::Reopen(), s_ReopenEntered, CFileDiagHandler::x_GetDiagFileType(), and CFileDiagHandler::x_GetHandler().
|
virtual |
Implementation of CDiagHandler.
Implements CDiagHandler.
Definition at line 7267 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.
|
virtual |
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().
|
pure virtual |
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().
void CSysLog::Post | ( | const string & | message, |
EPriority | priority, | ||
EFacility | facility = eDefaultFacility |
||
) |
Definition at line 117 of file syslog.cpp.
References CSysLog::Post(), and CSysLog::x_TranslateFacility().
Definition at line 123 of file syslog.cpp.
References CSysLog::fCopyToStderr, CSysLog::fIncludePID, CSysLog::fNoOverride, LOG_MAKEPRI, CSysLog::m_Flags, CSysLog::sm_Current, and CSysLog::x_Connect().
|
inline |
Log the timing; stop and deactivate the timer.
resource | Name of the resource (must be non-empty, else throws an exception). |
status | Status of the timed code. |
status_msg | Verbal description of the status of the timed code. |
Definition at line 436 of file perf_log.hpp.
Referenced by g_DoErasePerfLogging(), g_DoPerfLogging(), CPerfLogGuard::Post(), and s_DoDonePerfLogging().
|
inline |
Write the collected resource info and timing to the log.
status | Status of the timed code. |
status_msg | Verbal description of the status of the timed code. |
Definition at line 578 of file perf_log.hpp.
Referenced by CGridRPCBaseClient< CAsnBinCompressed >::Ask(), CGridRPCBaseClient< CAsnBinCompressed >::AskStream(), ColumnarVcfCache::CreateBlob(), CGridRPCBaseClient< CAsnBinCompressed >::x_GetJobById(), CTMS_DisplayTrack_Client::x_HttpFetch(), and CPerfLogGuard::~CPerfLogGuard().
CDiagContext_Extra CPerfLogger::Post | ( | int | status, |
CTempString | resource, | ||
CTempString | status_msg = CTempString() |
||
) |
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().
void CPerfLogGuard::Post | ( | int | status, |
CTempString | status_msg = CTempString() |
||
) |
Definition at line 113 of file perf_log.cpp.
References CPerfLogGuard::Discard(), ERR_POST_ONCE, Error(), CPerfLogger::IsON(), CPerfLogger::m_IsDiscarded, CPerfLogGuard::m_Logger, CPerfLogGuard::m_Parameters, CPerfLogGuard::m_Resource, CPerfLogger::Post(), and CDiagContext_Extra::Print().
|
virtual |
Post message to console regardless of its severity.
Reimplemented in CTeeDiagHandler.
Definition at line 6359 of file ncbidiag.cpp.
References CDiagLock::ePost, CDiagHandler::GetLogName(), IsVisibleDiagPostLevel(), kLogName_Stderr, SDiagMessage::m_Severity, NcbiFlush, and str().
Referenced by CTeeDiagHandler::PostToConsole().
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
bool | value | ||
) |
Definition at line 2732 of file ncbidiag.cpp.
References NStr::BoolToString(), CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
char | value | ||
) |
Definition at line 2708 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
const char * | value | ||
) |
Overloaded Print() for all types.
Definition at line 2653 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), and rapidjson::value.
|
inline |
Definition at line 1857 of file ncbidiag.hpp.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
const string & | value | ||
) |
The method does not print the argument, but adds it to the string.
Name must contain only alphanumeric chars or '_'. Value is URL-encoded before printing.
Definition at line 2622 of file ncbidiag.cpp.
References ERR_POST, kEmptyStr, CDiagContext_Extra::m_Args, s_NcbiApplogKeywords, rapidjson::value, and CDiagContext_Extra::x_CanPrint().
Referenced by CGRPCServerCallbacks::BeginRequest(), CGRPCRequestLogger::CGRPCRequestLogger(), CWNJobWatcher::CheckForInfiniteLoop(), CCgi2RCgiApp::CheckJob(), CVcfTrack::CheckRange(), CompressAssembly(), ColumnarVcfCache::CreateBlob(), CreateErrorRequestContext(), CNetScheduleServer::Exit(), g_DoErasePerfLogging(), g_DoPerfLogging(), g_PostPerf(), CBlastAligner::GenerateAlignments(), CNetStorageHandler::OnClose(), CJaegerTracer::OnRequestStart(), CPerfLogGuard::Post(), CDiagContext_Extra::Print(), SInteractiveNewRequestStart::SExtra::Print(), CStatisticsCounters::PrintDelta(), CDiagContext_Extra::PrintNcbiAppInfoOnRequest(), CDiagContext_Extra::PrintNcbiAppInfoOnStart(), CDiagContext_Extra::PrintNcbiRoleAndLocation(), CHttpRequest::PrintParams(), CStatisticsCounters::PrintServerWide(), CDiagContext::PrintStart(), CQueue::PrintStatistics(), CStatisticsCounters::PrintTransitions(), CCgiSampleApplication::ProcessPrintEnvironment(), COperationTiming::Register(), CIgBlast::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), CNetStorageGCApp::Run(), CAdvancedAlignCleanup::RunSplignOnCompartment(), s_AppendCommonExtras(), CSparseGraph::Save(), ColumnarVcfCache::SetInfoFields(), CDiagContext_Extra::SetType(), CCgi2RCgiApp::SubmitJob(), UncomressAndCreate(), CNgAligner::x_Align_Impl(), CQueue::x_CancelJobs(), CQueue::x_CheckExecutionTimeout(), CSparseGraph::x_CheckRemoteData(), CQueueDataBase::x_CreateAndMountQueue(), CPubseqGatewayApp::x_CreateRequestContext(), CPubseqGatewayApp::x_DispatchRequest(), CNetStorageHandler::x_GetObject(), CGRPCRequestLogger::x_Init(), CNetScheduleHandler::x_LogCommandWithJob(), CDBConnectionFactory::x_LogConnection(), CDiagContext::x_LogEnvironment(), CRequestContext::x_LogHitID(), CDiagContext::x_LogHitID(), CNcbiApplicationAPI::x_LogOptions(), CQueue::x_LogSubmit(), CHttpConnection::x_MaintainBacklog(), CNcbiLogFields::x_Match(), CCgiApplication::x_OnEvent(), CQueueDataBase::x_Open(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageGCApp::x_PrintFinishCounters(), CNetScheduleHandler::x_PrintGetJobResponse(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetStorageHandler::x_PrintMessageRequestStop(), CNetScheduleHandler::x_ProcessChangeAffinity(), CNetScheduleHandler::x_ProcessClearWorkerNode(), CNetStorageHandler::x_ProcessCreate(), CNetScheduleHandler::x_ProcessGetJob(), CNetScheduleHandler::x_ProcessJobExchange(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessReading(), CNetStorageHandler::x_ProcessReconfigure(), CNetScheduleHandler::x_ProcessReloadConfig(), CNetStorageHandler::x_ProcessRelocate(), CNetScheduleHandler::x_ProcessSetAffinity(), CNetScheduleHandler::x_ProcessSetQueue(), CInstancedAligner::x_RunAligner(), CSparseGraph::x_Sync(), and CRequestContext::x_UpdateSubHitID().
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
double | value | ||
) |
Definition at line 2726 of file ncbidiag.cpp.
References NStr::DoubleToString(), CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
int | value | ||
) |
Definition at line 2659 of file ncbidiag.cpp.
References NStr::IntToString(), CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
Int8 | value | ||
) |
Definition at line 2684 of file ncbidiag.cpp.
References NStr::Int8ToString(), CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
long | value | ||
) |
Definition at line 2671 of file ncbidiag.cpp.
References NStr::LongToString(), CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
signed char | value | ||
) |
Definition at line 2714 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
Uint8 | value | ||
) |
Definition at line 2689 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), NStr::UInt8ToString(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
unsigned char | value | ||
) |
Definition at line 2720 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
unsigned int | value | ||
) |
Definition at line 2665 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), NStr::UIntToString(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | const string & | name, |
unsigned long | value | ||
) |
Definition at line 2677 of file ncbidiag.cpp.
References CDiagContext_Extra::Print(), NStr::ULongToString(), and rapidjson::value.
CDiagContext_Extra & CDiagContext_Extra::Print | ( | TExtraArgs & | args | ) |
The method does not print the arguments, but adds it to the string.
Name must contain only alphanumeric chars or '_'. Value is URL-encoded before printing. The args will be modified (emptied) by the function.
Definition at line 2738 of file ncbidiag.cpp.
References CDiagContext_Extra::m_Args, and CDiagContext_Extra::x_CanPrint().
Print extra message in plain text format.
This method is deprecated and should be replaced by a call to Extra() method and one or more calls to CDiagContext_Extra::Print().
Definition at line 2156 of file ncbidiag.cpp.
References SDiagMessage::eEvent_Extra, and CDiagContext::x_PrintMessage().
|
private |
Definition at line 2287 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().
|
private |
Definition at line 2237 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().
|
private |
Definition at line 2224 of file ncbidiag.cpp.
References CDiagContext::GetHostLocation(), CDiagContext::GetHostRole(), and CDiagContext_Extra::Print().
Referenced by CDiagContext_Extra::Flush(), and CDiagContext::PrintStart().
void CDiagContext::PrintProperties | ( | void | ) |
Forced dump of all set properties.
Definition at line 2085 of file ncbidiag.cpp.
References SDiagMessage::eEvent_Extra, CDiagLock::eRead, ITERATE, CDiagContext::m_Properties, and CDiagContext::x_PrintMessage().
Print request start message (for request-driven applications)
Definition at line 2762 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().
CDiagContext_Extra CDiagContext::PrintRequestStart | ( | void | ) |
Create a temporary CDiagContext_Extra object.
The object will print arguments automatically from destructor. Can be used like: PrintRequestStart().Print(name1, val1).Print(name2, val2);
Definition at line 2162 of file ncbidiag.cpp.
References CDiagContext::CDiagContext_Extra, and SDiagMessage::eEvent_RequestStart.
void CDiagContext::PrintRequestStop | ( | void | ) |
Print request stop message (for request-driven applications)
Definition at line 2778 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().
Print start/stop etc.
message. If the following values are set as properties, they will be dumped before the message: host | host_ip_addr client_ip session_id app_name All messages have the following prefix: PID/TID/ITER UID TIME HOST CLIENT SESSION_ID APP_NAME Depending on its type, a message can be prefixed with the following properties if they are set: start stop [SIG] [EXIT_CODE] ELAPSED_TIME extra request-start request-stop [STATUS] [REQ_ELAPSED_TIME] [BYTES_RD] [BYTES_WR]
Definition at line 2095 of file ncbidiag.cpp.
References SDiagMessage::eEvent_Start, CDiagContext::eHitID_NoCreate, env, CFile::Exists(), CDiagContext::Extra(), f(), CDiagContext_Extra::Flush(), NStr::fSplit_Tokenize, in(), n, NPOS, CDiagContext_Extra::Print(), CDiagContext_Extra::PrintNcbiAppInfoOnRequest(), CDiagContext_Extra::PrintNcbiAppInfoOnStart(), CDiagContext_Extra::PrintNcbiRoleAndLocation(), NStr::ReplaceInPlace(), NStr::SplitInTwo(), NStr::ToLower(), NStr::TruncateSpaces(), rapidjson::value, CDiagContext::x_GetDefaultHitID(), CDiagContext::x_LogEnvironment(), and CDiagContext::x_PrintMessage().
Referenced by CCgiApplication::AppStart(), and CNcbiApplicationAPI::AppStart().
void CDiagContext::PrintStop | ( | void | ) |
Print exit message.
Definition at line 2139 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::SpawnL(), CExec::SpawnLE(), CExec::SpawnLP(), CExec::SpawnLPE(), CExec::SpawnV(), CExec::SpawnVE(), CExec::SpawnVP(), CExec::SpawnVPE(), and CDiagContext::sx_ThreadDataTlsCleanup().
void PushDiagPostPrefix | ( | const char * | prefix | ) |
Push a string to the list of message prefixes.
Definition at line 6109 of file ncbidiag.cpp.
References buf, GetDiagBuffer(), and prefix.
Referenced by CDiagAutoPrefix::CDiagAutoPrefix(), and CCgiApplication::Run().
void CDiagContext::PushMessage | ( | const SDiagMessage & | message | ) |
Save new message.
Definition at line 3379 of file ncbidiag.cpp.
References CDiagContext::m_MaxMessages, and CDiagContext::m_Messages.
|
inline |
Helper method to post an exception to diagnostic stream.
Example: CNcbiDiag() << ex;
Definition at line 975 of file ncbidiag.hpp.
References CNcbiDiag::x_Put().
const CNcbiDiag & CNcbiDiag::Put | ( | const CStackTrace * | , |
const CStackTrace & | stacktrace | ||
) | const |
Helper method to post stack trace to diagnostic stream using standard stack trace formatting.
Example: CNcbiDiag() << "My message" << CStackTrace();
Definition at line 7790 of file ncbidiag.cpp.
References CStackTrace::Empty(), s_FormatStackTrace(), and CStackTrace::SetPrefix().
Helper method to post error code and subcode to diagnostic stream.
Example: CNcbiDiag() << ErrCode(5,3) << "My message";
Definition at line 980 of file ncbidiag.hpp.
References CNcbiDiag::Put(), and CNcbiDiag::x_Put().
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.
const CNcbiDiag& CNcbiDiag::Put | ( | const NCBI_NS_NCBI::SetPostFlags * | , |
const NCBI_NS_NCBI::SetPostFlags & | flags | ||
) | const |
Helper method to set specific post flags.
Example: CNcbiDiag() << SetPostFlags(eDPF_DateTime) << "My message";
Helper method to set severity level.
Example: CNcbiDiag() << Severity(eDiag_Error) << "My message";
Generic method to post to diagnostic stream.
Referenced by CNcbiDiag::operator<<(), and CNcbiDiag::Put().
bool CDiagErrCodeInfo::Read | ( | CNcbiIstream & | is | ) |
Read error description from specified stream.
Read error descriptions from the specified stream, store it in memory.
Definition at line 8260 of file ncbidiag.cpp.
References ErrCode, kEmptyStr, NcbiGetlineEOL(), s_ParseErrCodeInfoStr(), CDiagErrCodeInfo::SetDescription(), NStr::StartsWith(), and str().
Read error description from specified file.
Read error descriptions from the specified file, store it in memory.
Definition at line 8188 of file ncbidiag.cpp.
References file_name.
void CDiagCollectGuard::Release | ( | EAction | action | ) |
Release the guard.
Perform the specified action, stop collecting messages, reset severities set by this guard.
Definition at line 582 of file ncbidiag.cpp.
References CDiagCollectGuard::Release(), and CDiagCollectGuard::SetAction().
void CDiagCollectGuard::Release | ( | void | ) |
Release the guard.
Perform the currently set action, stop collecting messages, reset severities set by this guard.
Definition at line 575 of file ncbidiag.cpp.
References CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::RemoveCollectGuard().
Referenced by CConnTestThread::Main(), CDiagCollectGuard::Release(), CRPCClient_Base::x_Ask(), and CDiagCollectGuard::~CDiagCollectGuard().
void CRequestContextGuard_Base::Release | ( | void | ) |
Release the guarded context, restore the saved context if any, do not perform any other actions (logging, setting status).
Definition at line 944 of file request_ctx.cpp.
References GetDiagContext(), CRef< C, Locker >::GetNonNullPointer(), CRequestContextGuard_Base::m_RequestContext, CRequestContextGuard_Base::m_SavedContext, CRef< C, Locker >::Reset(), and CDiagContext::SetRequestContext().
void CAsyncDiagHandler::RemoveFromDiag | ( | void | ) |
Remove this DiagHandler from diagnostics.
This method must be called if InstallToDiag was called. Object cannot be destroyed if InstallToDiag was called and RemoveFromDiag wasn't called. If InstallToDiag wasn't called then this method does nothing and is safe to be executed.
Definition at line 7242 of file ncbidiag.cpp.
References _ASSERT, GetDiagHandler(), CAsyncDiagHandler::m_AsyncThread, CAsyncDiagThread::m_SubHandler, NULL, CObject::RemoveReference(), SetDiagHandler(), and CAsyncDiagThread::Stop().
|
virtual |
Reopen file to enable log rotation.
Reimplemented from CDiagHandler.
Definition at line 6522 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().
|
virtual |
Reopen file to enable log rotation.
Reimplemented from CDiagHandler.
Definition at line 7039 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().
|
virtual |
Reopen file to enable log rotation.
Reimplemented from CDiagHandler.
Definition at line 7261 of file ncbidiag.cpp.
References flags, CAsyncDiagHandler::m_AsyncThread, CAsyncDiagThread::m_SubHandler, and CDiagHandler::Reopen().
|
inlinevirtual |
Reopen file to enable log rotation.
Reimplemented in CTeeDiagHandler, CAsyncDiagHandler, CFileDiagHandler, and CFileHandleDiagHandler.
Definition at line 2480 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::Reopen(), CAsyncDiagHandler::Reopen(), and CTeeDiagHandler::Reopen().
|
inline |
Reset property.
Definition at line 1000 of file request_ctx.hpp.
References CRequestContext_PassThrough::m_Context, and CRequestContext::x_ResetPassThroughProp().
void CRequestContext::Reset | ( | void | ) |
Reset all properties to the initial state.
Definition at line 271 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().
|
inline |
Reset IsConsole flag.
Definition at line 1197 of file ncbidiag.hpp.
References eDPF_IsConsole, and CNcbiDiag::m_PostFlags.
|
inline |
Definition at line 1191 of file ncbidiag.hpp.
References CNcbiDiag::ResetIsNoteFlag().
|
inline |
Reset IsNote flag.
Definition at line 1194 of file ncbidiag.hpp.
References eDPF_IsNote, and CNcbiDiag::m_PostFlags.
Referenced by CNcbiDiag::ResetIsMessageFlag().
|
private |
Definition at line 1343 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.
TDiagPostFlags CNcbiDiag::ResetPostFlags | ( | TDiagPostFlags | flags | ) | const |
Clear specific post flags for the current message.
|
static |
Definition at line 5496 of file ncbidiag.cpp.
Referenced by SDiagMessage::x_NewWrite().
|
static |
Definition at line 5515 of file ncbidiag.cpp.
|
inline |
Destructor.
message | Message |
explanation | Explanation of msg. |
severity | Do not override if set to -1 |
Definition at line 2999 of file ncbidiag.hpp.
SDiagErrCodeDescription::SDiagErrCodeDescription | ( | void | ) |
Constructor.
Definition at line 8179 of file ncbidiag.cpp.
SDiagMessage::SDiagMessage | ( | const SDiagMessage & | message | ) |
Copy constructor required to store the messages and flush them when the diagnostics setup is finished.
Definition at line 4582 of file ncbidiag.cpp.
Parse a string back into SDiagMessage.
Optional bool argument is set to true if the message was parsed successfully.
Definition at line 4540 of file ncbidiag.cpp.
References SDiagMessage::ParseMessage(), and result.
SDiagMessage::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 4486 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, prefix, and CRequestContext::SetRequestID().
Referenced by SDiagMessage::ParseDiagStream().
Select the last hit id from the list of ids separated with commas and optional spaces.
Definition at line 598 of file request_ctx.cpp.
References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, kEmptyStr, NPOS, and NStr::Split().
Referenced by CDiagContext::x_GetDefaultHitID(), and CCgiRequest::x_InitRequestContext().
Select the last session id from the list of ids separated with commas and optional spaces, ignore UNK_SESSION value.
Definition at line 612 of file request_ctx.cpp.
References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, kEmptyStr, NPOS, REVERSE_ITERATE, and NStr::Split().
Referenced by CCgiContext::RetrieveTrackingId().
Serialize current values using the specified format.
Definition at line 852 of file request_ctx.cpp.
References CRequestContext_PassThrough::eFormat_UrlEncoded, format, kEmptyStr, CRequestContext_PassThrough::m_Context, CRequestContext_PassThrough::x_SerializeUrlEncoded(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inline |
Set or update property value.
Definition at line 986 of file request_ctx.hpp.
References CRequestContext_PassThrough::m_Context, rapidjson::value, and CRequestContext::x_SetPassThroughProp().
void SetAbortHandler | ( | FAbortHandler | func = 0 | ) |
Set/unset abort handler.
If "func"==0 use default handler.
Definition at line 8141 of file ncbidiag.cpp.
References s_UserAbortHandler.
|
inline |
Specify on-destroy action.
Definition at line 1362 of file ncbidiag.hpp.
References CDiagCollectGuard::m_Action.
Referenced by CDiagCollectGuard::Release(), and CDBLBClientApp::x_RunLookup().
|
static |
Definition at line 565 of file request_ctx.cpp.
Referenced by main().
void CNcbiDiag::SetAllPostFlags | ( | TDiagPostFlags | flags | ) | const |
Set new post flags for the current message.
Definition at line 2298 of file ncbidiag.hpp.
References CDiagContext::sm_ApplogSeverityLocked.
Referenced by SetDiagHandler(), SetLogFile(), CDiagContext::SetupDiag(), and CDiagRestorer::~CDiagRestorer().
Set application name.
Definition at line 1884 of file ncbidiag.cpp.
References ERR_POST, CDiagContext::m_AppName, and CDiagContext::m_AppNameSet.
Referenced by CNcbiApplicationAPI::SetProgramDisplayName(), and CDiagContext::SetProperty().
void CDiagContext::SetAppState | ( | EDiagAppState | state | ) |
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 2815 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().
void CRequestContext::SetAppState | ( | EDiagAppState | state | ) |
Definition at line 264 of file request_ctx.cpp.
References CRequestContext::m_AppState, and CRequestContext::x_CanModify().
Referenced by CDiagContext::SetAppState(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), SWorkerNodeJobContextImpl::x_RunJob(), and SOfflineJobContextImpl::x_RunJob().
void CDiagContext::SetAppState | ( | EDiagAppState | state, |
EPropertyMode | mode | ||
) |
The 'mode' flag is deprecated.
Use CRequestContext::SetAppState() for per-thread/per-request state.
Definition at line 2838 of file ncbidiag.cpp.
References CDiagContext::eProp_Default, CDiagContext::eProp_Global, CDiagContext::eProp_Thread, CDiagContext::GetRequestContext(), CDiagContext::SetAppState(), CRequestContext::SetAppState(), and CDiagContext::SetGlobalAppState().
|
inline |
Auto-increment request ID with every posted message.
Definition at line 304 of file request_ctx.hpp.
References CRequestContext::m_AutoIncOnPost.
Referenced by CDiagContextThreadData::CDiagContextThreadData(), and main().
void CDiagContext::SetAutoWrite | ( | bool | value | ) |
Set AutoWrite flag.
If set, each property is posted to the current app-log stream when a new value is set.
Definition at line 1913 of file ncbidiag.cpp.
References s_AutoWrite_Context, and rapidjson::value.
|
static |
Definition at line 553 of file request_ctx.cpp.
|
inline |
Definition at line 864 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().
|
inline |
Definition at line 893 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().
Set class name.
Definition at line 7760 of file ncbidiag.cpp.
References CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetClass().
Definition at line 757 of file ncbidiag.cpp.
References CDiagCompileInfo::m_ClassName, and CDiagCompileInfo::m_ClassSet.
Referenced by CNcbiDiag::SetClass().
Definition at line 318 of file request_ctx.cpp.
References client, CRequestContext::eProp_ClientIP, ERR_POST_X, ip, NStr::IsIPAddress(), kBadIP, CRequestContext::m_ClientIP, NStr::TruncateSpaces(), 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().
void CDiagCollectGuard::SetCollectSeverity | ( | EDiagSev | sev | ) |
Set new collect severity.
The new collect severity can not be higher than the current one.
Definition at line 597 of file ncbidiag.cpp.
References CompareDiagPostLevel(), and CDiagCollectGuard::m_CollectSev.
Set custom suffix to use on all threads in the server's pool.
Value can be set only before call to InstallToDiag(), any change of the value after call to InstallToDiag() will be ignored.
Definition at line 7219 of file ncbidiag.cpp.
References CAsyncDiagHandler::m_ThreadSuffix, and suffix.
|
static |
Set default auto-increment flag used for each default request context.
Contexts created by users do not check this flag. The flag is not MT-protected.
Definition at line 377 of file request_ctx.cpp.
References CRequestContext::sx_GetDefaultAutoIncRequestIDOnPost().
Referenced by main().
Set new default client ip.
This value is used only if by the time 'request start' is logged there's no explicit ip set in the current request context.
Definition at line 2938 of file ncbidiag.cpp.
References s_DefaultClientIp.
void CRequestContextGuard_Base::SetDefaultErrorStatus | ( | int | status | ) |
Set default error status, which will be used if an uncaught exception is detected.
Definition at line 954 of file request_ctx.cpp.
References CRef< C, Locker >::GetNonNullPointer(), CRequestContextGuard_Base::m_ErrorStatus, and CRequestContextGuard_Base::m_RequestContext.
Set new global default hit id.
This value is used only if the per-request hit id is not set.
Definition at line 3062 of file ncbidiag.cpp.
References CDiagContext::m_DefaultHitId, CDiagContext::m_LoggedHitId, and CDiagContext::x_LogHitID().
Set new default session id.
This value is used only if the per-request session id is not set.
Definition at line 2893 of file ncbidiag.cpp.
References CDiagContext::m_DefaultSessionId.
void CDiagErrCodeInfo::SetDescription | ( | const ErrCode & | err_code, |
const SDiagErrCodeDescription & | description | ||
) |
Set error description for specified error code.
If description for this code already exist, then it will be overwritten.
Referenced by CDiagErrCodeInfo::Read().
EDiagSev SetDiagDieLevel | ( | EDiagSev | die_sev = eDiag_Fatal | ) |
Set the "die" (abort) level for the program.
Abort the application if severity is >= "die_sev". Throw an exception if die_sev is not in the range [eDiagSevMin..eDiag_Fatal].
Definition at line 6196 of file ncbidiag.cpp.
References eDiag_Fatal, CDiagLock::eWrite, and NCBI_THROW.
void SetDiagErrCodeInfo | ( | CDiagErrCodeInfo * | info, |
bool | can_delete = true |
||
) |
Set handler for processing error codes.
By default this handler is unset. NcbiApplication can init itself only if registry key DIAG_MESSAGE_FILE section DEBUG) is specified. The value of this key should be a name of the file with the error codes explanations.
Definition at line 7644 of file ncbidiag.cpp.
References CDiagLock::eWrite, and info.
Referenced by CNcbiApplicationAPI::x_HonorStandardSettings(), CDiagRecycler::~CDiagRecycler(), and CDiagRestorer::~CDiagRestorer().
void SetDiagFilter | ( | EDiagFilter | what, |
const char * | filter_str | ||
) |
Set diagnostic filter.
Diagnostic filter acts as a second level filtering mechanism (the primary established by global error post level)
what | Filter is set for |
filter_str | Filter string |
Definition at line 7670 of file ncbidiag.cpp.
References eDiagFilter_All, eDiagFilter_Post, eDiagFilter_Trace, CDiagLock::eWrite, s_PostFilter, and s_TraceFilter.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), main(), CConnTestThread::Main(), s_CombineDustMasksWithUserProvidedMasks(), CLogLatencyReport::Start(), CNcbiApplicationAPI::x_HonorStandardSettings(), CBioseqIndex::x_InitFeats(), and CCdregionValidator::x_ValidateCDSPeptides().
void SetDiagFixedPostLevel | ( | EDiagSev | post_sev | ) |
Sets and locks the level, combining the previous two calls.
Definition at line 6179 of file ncbidiag.cpp.
References DisableDiagPostLevelChange(), and SetDiagPostLevel().
Referenced by CNcbiApplicationAPI::AppMain(), and CNcbiApplicationAPI::x_HonorStandardSettings().
void SetDiagHandler | ( | CDiagHandler * | handler, |
bool | can_delete = true |
||
) |
Set the diagnostic handler using the specified diagnostic handler class.
Definition at line 6288 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().
void SetDiagHandler | ( | FDiagHandler | func, |
void * | data, | ||
FDiagCleanup | cleanup | ||
) |
Set the diagnostic handler using the specified diagnostic handler and cleanup functions.
Definition at line 8049 of file ncbidiag.cpp.
References cleanup(), data, and SetDiagHandler().
TDiagPostFlags SetDiagPostAllFlags | ( | TDiagPostFlags | flags | ) |
Set global post flags to "flags".
If "flags" have flag eDPF_Default set, it will be replaced by the current global post flags.
Definition at line 6065 of file ncbidiag.cpp.
References flags, and s_SetDiagPostAllFlags().
Referenced by CNcbiApplicationAPI::AppMain(), CCgiApplication::ConfigureDiagFormat(), CProjBulderApp::GenerateSummary(), CGridCommandLineInterfaceApp::Run(), and CProjBulderApp::Run().
void SetDiagPostFlag | ( | EDiagPostFlag | flag | ) |
Set the specified flag (globally).
Definition at line 6070 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().
EDiagSev SetDiagPostLevel | ( | EDiagSev | post_sev = eDiag_Error | ) |
Set the threshold severity for posting the messages.
This function has effect only if:
Another way to do filtering is to call SetDiagFilter
post_sev | Post only messages with severity greater or equal to "post_sev". |
Special case: eDiag_Trace – print all messages and turn on the tracing.
Definition at line 6129 of file ncbidiag.cpp.
References eDiag_Info, eDiag_Trace, eDiagSC_Disable, eDiagSevMax, eDT_Enable, CDiagLock::eWrite, NCBI_THROW, and SetDiagTrace().
Referenced by UpdateViewer::BlastNeighbor(), BOOST_AUTO_TEST_CASE(), CAV_DisplayMultiple(), CDiagLevelGuard::CDiagLevelGuard(), Cn3DApp::Cn3DApp(), CCgiApplication::ConfigureDiagThreshold(), CreateMimeFromBiostruc(), BlockMultipleAlignment::ExtractRows(), GetStructureFromCacheFolder(), UpdateViewer::ImportStructure(), CReadresult::Init(), COMSSABase::Init(), COMSSAMerge::Init(), CCompactSAMApplication::Init(), CExonSelectorApplication::Init(), CUsageReportSampleApp::Init(), CNCBIwxApplication::Init(), CXcompareAnnotsApplication::Init(), Cn3DNoWin::Init(), CHgvsToSeqfeatConverter::Init(), CBDB_PhoneBookDemo1::Init(), CBDB_PhoneBookDemo2::Init(), CBDB_PhoneBookDemo3::Init(), CBDB_BLobDemo1::Init(), CBDB_SplitTest::Init(), CBDB_MergeTest::Init(), CTestApplication::Init(), CApp::Init(), CSampleNetScheduleClient::Init(), CSampleNetScheduleNode::Init(), CDataTool::Init(), LoadASNFromIstream(), LoadDataOnly(), main(), ReadCD(), CBasicFastaWrapper::ReadFile(), AlignmentManager::RealignDependentSequences(), CNgAlignApp::Run(), CMkIndexApplication::Run(), COMSSA::Run(), CBlastFormatterApp::Run(), CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CSeedTopApp::Run(), CTblastnApp::Run(), CTblastxApp::Run(), CBlastdbConvertApp::Run(), CMakeBlastDBApp::Run(), CMakeClusterDBApp::Run(), CBlastVdbCmdApp::Run(), CGridCommandLineInterfaceApp::Run(), CIgBlastnApp::Run(), CIgBlastpApp::Run(), CMagicBlastApp::Run(), CRMBlastnApp::Run(), CVecScreenApp::Run(), CBlastKmerBuildIndexApplication::Run(), CMultiApplication::Run(), CAsn2Asn::Run(), BlastdbCopyApplication::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CId1FetchApp::Run(), CId2FetchApp::Run(), CSplitCacheApp::Run(), CWig2tableApplication::Run(), CWinMaskApplication::Run(), CProjBulderApp::Run(), CBam2GraphApp::Run(), s_Dump(), s_DumpSparse(), s_DumpZero(), s_InitializeSubject(), SDiagRestorer::SDiagRestorer(), SetDiagFixedPostLevel(), CDiagContext::SetupDiag(), CTar::x_ReadEntryInfo(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), CDiagLevelGuard::~CDiagLevelGuard(), and SDiagRestorer::~SDiagRestorer().
void SetDiagPostPrefix | ( | const char * | prefix | ) |
Specify a string to prefix all subsequent error postings with.
Definition at line 6097 of file ncbidiag.cpp.
References buf, GetDiagBuffer(), and prefix.
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().
void SetDiagRequestId | ( | Uint8 | id | ) |
Set iteration number/request ID.
Definition at line 1201 of file ncbidiag.cpp.
References GetDiagContext(), CDiagContext::GetRequestContext(), and CRequestContext::SetRequestID().
Referenced by SetFastCGIIteration(), and CFastCgiApplicationMT::x_ProcessThreadedRequest().
void SetDiagStream | ( | CNcbiOstream * | os, |
bool | quick_flush = true , |
||
FDiagCleanup | cleanup = 0 , |
||
void * | cleanup_data = 0 , |
||
const string & | stream_name = "" |
||
) |
Set diagnostic stream.
Error diagnostics are written to output stream "os". This uses the SetDiagHandler() functionality.
quick_flush | Do stream flush after every message |
cleanup | Call "cleanup(cleanup_data)" if diag. |
cleanup_data | Stream is changed (see SetDiagHandler) |
stream_name | Stream name (e.g. STDERR, file.log) |
Definition at line 8083 of file ncbidiag.cpp.
References cleanup(), kLogName_Stderr, kLogName_Stdout, kLogName_Stream, NCBI_LSAN_DISABLE_GUARD, and SetDiagHandler().
Referenced by BOOST_AUTO_TEST_CASE(), CAV_DisplayMultiple(), CNcbiApplogApp::Cmd_Health(), CNCBIwxApplication::Exit(), CTestCompartApplication::Exit(), CDemoScoreBuilderApp::Exit(), CBlastInputDemoApplication::Exit(), CGumbelParamsApplication::Exit(), CBlastKmerApplication::Exit(), CBlastKmerBuildIndexApplication::Exit(), CClustererApplication::Exit(), CMultiApplication::Exit(), COmssa2pepxmlApplication::Exit(), CAgpValidateApplication::Exit(), CAgpconvertApplication::Exit(), CAsnCacheTestApplication::Exit(), CCacheIndexCopyApp::Exit(), CConcatSeqEntriesApplication::Exit(), CAsnCacheDumpSeqIdsApplication::Exit(), CPrimeCacheApplication::Exit(), CReadIndexSpeedApp::Exit(), CAsnSubCacheCreateApplication::Exit(), CWalkAsnCacheApplication::Exit(), CBlastDbCheckApplication::Exit(), BlastdbCopyApplication::Exit(), CConvert2BlastMaskApplication::Exit(), CGuideTreeApplication::Exit(), CVDBBlastnApp::Exit(), CVDBTblastnApp::Exit(), Cn3DNoWin::Exit(), CFeatImportApp::Exit(), CFormatGuessApp::Exit(), CId1FetchApp::Exit(), CId2FetchApp::Exit(), CNmer_repeatsApplication::Exit(), CObjExtractApp::Exit(), SegMaskerApplication::Exit(), CMytestApplication::Exit(), CStreamTestApp::Exit(), CObjConvProfile::Exit(), CAppJobTestApplication::Exit(), CTestDispatchApp::Exit(), CColumnarVCFReaderApp::Exit(), CReadFilesApp::Exit(), CProcessFilesApp::Exit(), CDbapiSimpleApp::Exit(), CBam2GraphApp::Exit(), CConvImageApp::Exit(), CImageDemoApp::Exit(), CSubImageApp::Exit(), CNcbiApplicationAPI::FlushDiag(), main(), Cn3DApp::OnExit(), CTbl2AsnApp::ProcessOneFile(), CNcbiApplogApp::Run(), CAsn2Asn::Run(), CId1FetchApp::Run(), CId2FetchApp::Run(), CAlnVwrApp::Run(), SetLogFile(), CAlnMrgApp::SetOptions(), and CDiagContext::SetupDiag().
void SetDiagTrace | ( | EDiagTrace | how, |
EDiagTrace | dflt = eDT_Default |
||
) |
Set the diagnostic trace settings.
Definition at line 6226 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().
TDiagPostFlags SetDiagTraceAllFlags | ( | TDiagPostFlags | flags | ) |
Versions of the above for extra trace flags.
ATTENTION: Thus set trace flags will be ADDED to the regular posting flags.
Definition at line 6081 of file ncbidiag.cpp.
References flags, and s_SetDiagPostAllFlags().
Referenced by CGridCommandLineInterfaceApp::Run().
void SetDiagTraceFlag | ( | EDiagPostFlag | flag | ) |
Definition at line 6086 of file ncbidiag.cpp.
References s_SetDiagPostFlag().
Referenced by CCgiApplication::CCgiApplication().
void SetDiagUserAndHost | ( | TDiagUserAndHost | flags = fDiag_AddUser|fDiag_AddHost | ) |
Set username and hostname properties for the diag context.
Do not update existing properties if fDiag_OverrideExisting is not set.
Definition at line 42 of file ncbi_userhost.cpp.
References CORE_GetUsername(), ctx, fDiag_AddHost, fDiag_AddUser, fDiag_OverrideExisting, flags, GetDiagContext(), CSocketAPI::gethostname(), CDiagContext::SetHostname(), and CDiagContext::SetUsername().
Referenced by SNetScheduleAPIImpl::Init(), and CGridCommandLineInterfaceApp::Run().
void SetDoubleDiagHandler | ( | void | ) |
Output diagnostics using both old and new style handlers.
Definition at line 8129 of file ncbidiag.cpp.
References ERR_POST_X, and Error().
Definition at line 805 of file request_ctx.hpp.
References CRequestContext::eProp_Dtab, CRequestContext::m_Dtab, CRequestContext::x_CanModify(), and CRequestContext::x_SetProp().
Referenced by s_GetRequestDTab(), and CCgiRequest::x_InitRequestContext().
Set error code and subcode numbers.
Referenced by s_c2cxxErrorHandler(), and s_LOG_Handler().
|
inline |
Set exit code.
Definition at line 2176 of file ncbidiag.hpp.
References CDiagContext::m_ExitCode, and CDiagContext::m_ExitCodeSet.
Referenced by CNcbiApplicationAPI::AppMain(), CCgiApplication::AppStop(), main(), and CDiagContext::SetProperty().
|
inline |
Set exit signal.
Definition at line 2185 of file ncbidiag.hpp.
References CDiagContext::m_ExitSig.
Referenced by CDiagContext::SetProperty().
|
inline |
Definition at line 1417 of file ncbidiag.hpp.
References SetDiagRequestId().
Set file name to post.
Definition at line 7746 of file ncbidiag.cpp.
References file, CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetFile().
Referenced by s_c2cxxErrorHandler().
Definition at line 722 of file ncbidiag.cpp.
References file, CDiagCompileInfo::m_File, and CDiagCompileInfo::m_StrFile.
Referenced by CNcbiDiag::SetFile().
Set function name.
Definition at line 7767 of file ncbidiag.cpp.
References CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetFunction().
Definition at line 742 of file ncbidiag.cpp.
References CDiagCompileInfo::m_ClassName, CDiagCompileInfo::m_ClassSet, CDiagCompileInfo::m_CurrFunctName, CDiagCompileInfo::m_FunctName, CDiagCompileInfo::m_Parsed, CDiagCompileInfo::m_StrCurrFunctName, and NPOS.
Referenced by CNcbiDiag::SetFunction().
void CDiagContext::SetGlobalAppState | ( | EDiagAppState | state | ) |
Set global application state.
Do not change state of the current thread.
Definition at line 2809 of file ncbidiag.cpp.
References CDiagContext::m_AppState.
Referenced by CNcbiApplicationAPI::CNcbiApplicationAPI(), CDiagContext::SetAppState(), and CNcbiApplicationAPI::x_TryMain().
Set explicit hit id. The id is reset on request end.
Definition at line 410 of file request_ctx.cpp.
References CRequestContext::x_CanModify(), and CRequestContext::x_SetHitID().
Referenced by SNSCommandArguments::AssignValues(), SetSessionAndIPAndPHID(), CNCMessageHandler::x_AssignCmdParams(), CNetStorageHandler::x_CreateConnContext(), CCgiRequest::x_InitRequestContext(), CNetStorageGCApp::x_RemoveObjects(), and SWorkerNodeJobContextImpl::x_RunJob().
Set new hit id value. This resets sub-hit counter and makes it non-shared.
Definition at line 94 of file request_ctx.hpp.
References CDiagContext::GetAppState(), GetDiagContext(), CSharedHitId::m_AppState, CSharedHitId::m_SharedSubHitId, CSharedHitId::m_SubHitId, and CSharedHitId::x_SetHitId().
Referenced by CRequestContext::UnsetHitID().
Generate unique hit id, assign it to this request, return the hit id value.
Definition at line 217 of file request_ctx.cpp.
References GetDiagContext(), CSharedHitId::GetHitId(), CRequestContext::m_HitID, and CRequestContext::x_CanModify().
Referenced by CRequestContext::x_GetHitID().
Set host IP address.
Definition at line 1844 of file ncbidiag.cpp.
Referenced by CDiagContext::SetProperty().
Set hostname.
Definition at line 1838 of file ncbidiag.cpp.
Referenced by SetDiagUserAndHost(), and CDiagContext::SetProperty().
|
private |
Definition at line 736 of file ncbidiag.cpp.
References CDiagCompileInfo::m_Line.
Set line number for post.
Referenced by s_c2cxxErrorHandler().
bool CFileDiagHandler::SetLogFile | ( | const string & | file_name, |
EDiagFileType | file_type, | ||
bool | quick_flush | ||
) |
Set new log file.
file_name | File name. If file_type is eDiagFile_All, the output will be written to file_name.(err|log|trace). Otherwise the filename is used as-is. Special filenames are: "" - disable diag messages; "-" - print to stderr "/dev/null" - never add .(err|log|trace) to the name. |
file_type | Type of log file to set - error, trace or application log. |
quick_flush | Do stream flush after every message. |
Definition at line 6884 of file ncbidiag.cpp.
References eDiagFile_All, eDiagFile_Err, eDiagFile_Log, eDiagFile_Perf, eDiagFile_Trace, err_handler(), file_name, file_type, CDirEntry::GetBase(), CDirEntry::GetDir(), CDirEntry::GetExt(), kLogName_None, kLogName_Stderr, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_OwnErr, CFileDiagHandler::m_OwnLog, CFileDiagHandler::m_OwnPerf, CFileDiagHandler::m_OwnTrace, CFileDiagHandler::m_Perf, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::m_Trace, CStopWatch::Restart(), s_CreateHandler(), s_IsSpecialLogName(), s_SplitLogFile, CFileDiagHandler::SetLogName(), and CFileDiagHandler::x_SetHandler().
Referenced by CFileDiagHandler::CFileDiagHandler().
bool SetLogFile | ( | const string & | file_name, |
EDiagFileType | file_type = eDiagFile_All , |
||
bool | quick_flush = true |
||
) |
Set log files.
Send output to file_name or to file_name.(err|log|trace) depending on the split log file flag and file_type. If a single file type is selected, other types remain the same or are switched to stderr if their files have not been assigned yet. If split log flag is off, any file type except eDiagFile_All will be ignored. If the file_name contains one of the extensions .log, .err or .trace and the file type is eDiagFile_All, the extension will be removed before adding the new one. Return true on success, false if the file could not be open.
Definition at line 7528 of file ncbidiag.cpp.
References eDiagFile_All, ERR_POST_X, file_name, file_type, GetDiagHandler(), CDirEntry::GetDir(), Info(), kLogName_None, kLogName_Stderr, NcbiCerr, s_IsSpecialLogName(), s_SplitLogFile, CDiagContext::SetApplogSeverityLocked(), SetDiagHandler(), SetDiagStream(), and SetSplitLogFile().
Referenced by OpenLogFileFromConfig(), CDiagContext::SetupDiag(), and CAsnvalApp::x_AliasLogFile().
Definition at line 6414 of file ncbidiag.cpp.
References len, CStreamDiagHandler_Base::m_LogName, and min().
Referenced by CStreamDiagHandler::CStreamDiagHandler(), CStreamDiagHandler_Base::CStreamDiagHandler_Base(), CFileHandleDiagHandler::SetLogName(), and CFileDiagHandler::SetLogName().
Definition at line 6512 of file ncbidiag.cpp.
References CDirEntry::CreateAbsolutePath(), CDirEntry::IsAbsolutePath(), and CStreamDiagHandler_Base::SetLogName().
Referenced by CFileHandleDiagHandler::CFileHandleDiagHandler().
Definition at line 6752 of file ncbidiag.cpp.
References CDirEntry::CreateAbsolutePath(), CDirEntry::IsAbsolutePath(), and CStreamDiagHandler_Base::SetLogName().
Referenced by CFileDiagHandler::SetLogFile().
void CDiagContext::SetLogRate_Limit | ( | ELogRate_Type | type, |
unsigned int | limit | ||
) |
Definition at line 1380 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().
void CDiagContext::SetLogRate_Period | ( | ELogRate_Type | type, |
unsigned int | period | ||
) |
Definition at line 1434 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.
|
static |
Set log file truncation flag.
Definition at line 3475 of file ncbidiag.cpp.
References rapidjson::value.
Referenced by NcbiSys_main().
Set module name.
Definition at line 7753 of file ncbidiag.cpp.
References CNcbiDiag::m_CompileInfo, and CDiagCompileInfo::SetModule().
Referenced by s_c2cxxErrorHandler().
Definition at line 729 of file ncbidiag.cpp.
References CDiagCompileInfo::m_Module, and CDiagCompileInfo::m_StrModule.
Referenced by CNcbiDiag::SetModule().
|
static |
Set old/new format flag.
Definition at line 3352 of file ncbidiag.cpp.
References s_OldPostFormat, and rapidjson::value.
Referenced by init_common(), main(), Main(), s_RestoreOrigDiagHandler(), and CLogLatencyReport::Start().
|
inline |
Definition at line 1200 of file ncbidiag.hpp.
References CNcbiDiag::m_OmitStackTrace, and rapidjson::value.
Referenced by CExceptionReporter::ReportDefaultEx().
Turn performance logging on/off globally.
Definition at line 64 of file perf_log.cpp.
void CFileDiagHandler::SetOwnership | ( | CStreamDiagHandler_Base * | handler, |
bool | own | ||
) |
Change ownership for the given handler if it's currently installed.
Definition at line 6838 of file ncbidiag.cpp.
References CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_OwnErr, CFileDiagHandler::m_OwnLog, CFileDiagHandler::m_OwnPerf, CFileDiagHandler::m_OwnTrace, CFileDiagHandler::m_Perf, and CFileDiagHandler::m_Trace.
|
inline |
Definition at line 850 of file ncbidiag.hpp.
TDiagPostFlags CNcbiDiag::SetPostFlags | ( | TDiagPostFlags | flags | ) | const |
Set specific post flags for the current message.
void CDiagCollectGuard::SetPrintSeverity | ( | EDiagSev | sev | ) |
Set new print severity.
The new print severity can not be lower than the current one.
Definition at line 589 of file ncbidiag.cpp.
References CompareDiagPostLevel(), and CDiagCollectGuard::m_PrintSev.
Add/change property.
Definition at line 288 of file request_ctx.cpp.
References CRequestContext::m_Properties, rapidjson::value, and CRequestContext::x_CanModify().
Referenced by CPSGDataLoader_Impl::CPSGDataLoader_Impl(), CCgiApplication::ProcessHttpReferer(), s_GetNextLogPrefix(), CCgiRequest::x_InitRequestContext(), and CFastCgiApplicationMT::x_ProcessThreadedRequest().
void CDiagContext::SetProperty | ( | const string & | name, |
const string & | value, | ||
EPropertyMode | mode = eProp_Default |
||
) |
Set application context property by name.
Write property to the log if AutoPrint flag is set. Property mode defines if the property is a global or a per-thread one. By default unknown properties are set as thread-local.
Definition at line 1931 of file ncbidiag.cpp.
References SDiagMessage::eEvent_Extra, CDiagContext::eProp_Default, CDiagContext::eProp_Global, CDiagContext::eProp_Thread, CDiagLock::eRead, CDiagLock::eWrite, NStr::fConvErr_NoThrow, CDiagContext::GetRequestContext(), IsGlobalProperty(), CDiagContext::kProperty_AppName, CDiagContext::kProperty_AppState, CDiagContext::kProperty_BytesRd, CDiagContext::kProperty_BytesWr, CDiagContext::kProperty_ClientIP, CDiagContext::kProperty_ExitCode, CDiagContext::kProperty_ExitSig, CDiagContext::kProperty_HostIP, CDiagContext::kProperty_HostName, CDiagContext::kProperty_ReqStatus, CDiagContext::kProperty_ReqTime, CDiagContext::kProperty_SessionID, CDiagContext::kProperty_UserName, CDiagContext::m_Properties, s_AutoWrite_Context, s_StrToAppState(), CDiagContext::SetAppName(), CDiagContext::SetAppState(), CRequestContext::SetBytesRd(), CRequestContext::SetBytesWr(), CRequestContext::SetClientIP(), CDiagContext::SetExitCode(), CDiagContext::SetExitSignal(), CDiagContext::SetHostIP(), CDiagContext::SetHostname(), CRequestContext::SetRequestStatus(), CRequestContext::SetSessionID(), CDiagContext::SetUsername(), CDiagContext::sm_Instance, NStr::StringToInt(), NStr::StringToInt8(), CRequestContext::UnsetRequestStatus(), rapidjson::value, and CDiagContext::x_PrintMessage().
|
inline |
Switch request context to read-only mode.
A read-only context can be attached to multiple threads. The mode must be disabled before making any modifications (e.g. printing request-stop). To avoid overhead CRequestContext does not check if there are any threads currently using the same context in a different mode. Any attempts to modify request context while in read-only mode are ignored and reported as an error (once per process). Note that some const methods may still need to modify the context (e.g. GetHitID() generates a new hit id if it's not yet assigned). To prevent the above error from being logged, the method should be called at least once before switching to read-only mode.
Definition at line 372 of file request_ctx.hpp.
References CRequestContext::m_IsReadOnly.
Referenced by CPSGS_Request::SetRequestContext().
|
static |
Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()
Definition at line 1907 of file ncbidiag.cpp.
References ctx, CDiagContextThreadData::GetThreadData(), and CDiagContextThreadData::SetRequestContext().
Referenced by CNSClientsRegistry::ClearOnTimeout(), CreateErrorRequestContext(), CRequestContextSwitcher::CRequestContextSwitcher(), DismissErrorRequestContext(), SAsyncWriteTask::Execute(), CNetScheduleServer::Exit(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CNetStorageHandler::OnOverflow(), CNetStorageHandler::OnRead(), CStatisticsCounters::PrintServerWide(), CQueue::PrintStatistics(), CRequestContextSwitcher::Release(), CRequestContextGuard_Base::Release(), CNetStorageGCDatabase::RemoveObject(), SPSG_Request::SContext::Set(), CPSGS_Request::SetRequestContext(), SNewRequestContext::SNewRequestContext(), CThread::Wrapper(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CPubseqGatewayApp::x_CreateRequestContext(), CPubseqGatewayApp::x_DispatchRequest(), CGetJobNotificationThread::x_DoJob(), CJobQueueCleanerThread::x_DoJob(), CJobQueueExecutionWatcherThread::x_DoJob(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetScheduleHandler::x_PrintCmdRequestStop(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetStorageHandler::x_PrintMessageRequestStop(), CPubseqGatewayApp::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetStorageGCApp::x_RemoveObjects(), CGraphCache< TData >::x_Run(), CNetScheduleHandler::x_SetRequestContext(), CNcbiApplicationAPI::x_TryMain(), CRequestContextResetter::~CRequestContextResetter(), and SNewRequestContext::~SNewRequestContext().
|
inline |
Set request ID.
Definition at line 640 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().
|
inline |
Assign the next available request ID to this request.
Definition at line 649 of file request_ctx.hpp.
References CRequestContext::GetNextRequestID(), CRequestContext::m_RequestID, and CRequestContext::x_CanModify().
|
inline |
Definition at line 836 of file request_ctx.hpp.
References CRequestContext::SetRequestStatus(), and CRequestContext::x_CanModify().
|
inline |
Definition at line 828 of file request_ctx.hpp.
References CRequestContext::eProp_ReqStatus, CRequestContext::m_ReqStatus, CRequestContext::x_CanModify(), and CRequestContext::x_SetProp().
Referenced by CNcbiTestsObserver::assertion_result(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CNetScheduleHandler::OnMessage(), CNetScheduleHandler::OnTimeout(), CNetStorageHandler::OnTimeout(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CCgiApplication::SetHTTPStatus(), CCgiRequestProcessor::SetHTTPStatus(), CDiagContext::SetProperty(), CRequestContext::SetRequestStatus(), CRequestContextGuard_Base::SetStatus(), CCgiResponse::SetStatus(), CBlobCacher::x_CancelCaching(), CNCMessageHandler::x_CloseCmdAndConn(), CNCMessageHandler::x_CloseOnPeerError(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CBlobCacher::x_DelFileAndRetryCreate(), CNCMessageHandler::x_DoCmd_CopyProlong(), CNCMessageHandler::x_DoCmd_CopyPut(), CNCMessageHandler::x_DoCmd_Get(), CNCMessageHandler::x_DoCmd_GetStat(), CNCMessageHandler::x_DoCmd_HasBlob(), CNCMessageHandler::x_DoCmd_IC_Store(), CNCMessageHandler::x_DoCmd_Put(), CNCMessageHandler::x_DoCmd_ReConfig(), CNCMessageHandler::x_DoCmd_SetValid(), CNCMessageHandler::x_DoCmd_SyncGet(), CNCMessageHandler::x_DoCmd_SyncStart(), CSpaceShrinker::x_FinishMoves(), CNCMessageHandler::x_FinishReadingBlob(), CNCActiveSyncControl::x_FinishSync(), CNetScheduleHandler::x_HandleSocketErrorOnResponse(), CCgiApplication::x_OnEvent(), CNetStorageHandler::x_OnSocketWriteError(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageHandler::x_PrintMessageRequestStart(), SWorkerNodeJobContextImpl::x_PrintRequestStop(), CPSGS_Dispatcher::x_PrintRequestStop(), CNetScheduleHandler::x_ProcessMsgRequest(), CNCActiveHandler::x_ProcessPeerError(), CNCMessageHandler::x_ProxyToNextPeer(), CNCMessageHandler::x_ReadAuthMessage(), CNCMessageHandler::x_ReadBlobChunk(), CNCMessageHandler::x_ReadBlobChunkLength(), CNCMessageHandler::x_ReadBlobSignature(), CNCMessageHandler::x_ReadCommand(), CNCMessageHandler::x_ReportError(), CNetScheduleHandler::x_SetCmdRequestStatus(), CNetStorageHandler::x_SetCmdRequestStatus(), CNetScheduleHandler::x_SetConnRequestStatus(), CNetStorageHandler::x_SetConnRequestStatus(), CNCMessageHandler::x_StartCommand(), CNCMessageHandler::x_WaitForPeerAnswer(), CNCMessageHandler::x_WriteBlobData(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
|
inline |
Set request tracer to be called on context events (start/stop etc.).
Definition at line 384 of file request_ctx.hpp.
References CRequestContext::m_Tracer.
Definition at line 451 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().
Create and set new session ID.
Definition at line 246 of file request_ctx.cpp.
References ctx, GetDiagContext(), CEncodedString::GetOriginalString(), CRequestContext::GetRequestID(), and CRequestContext::m_SessionID.
Referenced by CRequestContext::GetSessionID().
|
inline |
Set new severity cap for use in PrintCapped mode.
Definition at line 1357 of file ncbidiag.hpp.
References CDiagCollectGuard::m_SeverityCap.
Referenced by CRPCClient_Base::x_Ask().
|
inline |
Mark this hit id as a shared one and start using shared counter.
Definition at line 80 of file request_ctx.hpp.
References CSharedHitId::IsShared(), CSharedHitId::m_SharedSubHitId, and CSharedHitId::m_SubHitId.
Referenced by CRequestContext::Clone().
Split log files flag.
If set, the output is sent to different log files depending on the severity level.
Definition at line 6705 of file ncbidiag.cpp.
References s_SplitLogFile, and rapidjson::value.
Referenced by main(), and SetLogFile().
|
inline |
Set request context status.
Definition at line 591 of file request_ctx.hpp.
References CRequestContextGuard_Base::m_RequestContext, and CRequestContext::SetRequestStatus().
Referenced by s_ReplyComplete< SInteractiveParams, no_testing, no_server_mode >(), s_ReplyComplete< SInteractiveParams, no_testing, server_mode >(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
void CFileDiagHandler::SetSubHandler | ( | CStreamDiagHandler_Base * | handler, |
EDiagFileType | file_type, | ||
bool | own | ||
) |
Definition at line 7016 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().
|
inline |
Definition at line 386 of file request_ctx.hpp.
References CRequestContext::m_TracerSpan.
CDiagContext_Extra & CDiagContext_Extra::SetType | ( | const string & | type | ) |
Set extra message type.
Definition at line 2754 of file ncbidiag.cpp.
References kExtraTypeArgName, CDiagContext_Extra::m_Typed, and CDiagContext_Extra::Print().
|
static |
Application-wide diagnostics setup.
Attempts to create log files or diag streams according to the 'ds' flag. If 'config' is set, gets name of the log file from the registry.
Definition at line 3545 of file ncbidiag.cpp.
References _ASSERT, _TRACE_X, CDirEntry::ConcatPath(), ctx, eDCM_Discard, eDCM_Flush, eDCM_Init, eDCM_InitNoLimit, eDCM_NoChange, eDiag_Warning, eDiagFile_All, eDiagSC_Unknown, eDS_AppSpecific, eDS_Default, eDS_Disable, eDS_ToMemory, eDS_ToStderr, eDS_ToStdlog, eDS_ToStdout, eDS_ToSyslog, eDS_User, CDiagContext::eLogRate_App, CDiagContext::eLogRate_Err, CDiagContext::eLogRate_Trace, CParamBase::EnableConfigDump(), ERR_POST_X, CDiagLock::eWrite, GetBase(), CDirEntry::GetBase(), GetDefaultLogLocation(), GetDiagContext(), GetDiagHandler(), CDiagHandler::GetLogName(), CDiagContext::GetLogTruncate(), CNcbiApplicationAPI::GetProgramExecutablePath(), CNcbiApplicationAPI::InstanceGuard(), kEmptyStr, kLogName_Memory, kLogName_None, kLogName_Stderr, kLogName_Stdout, CSysLog::kLogName_Syslog, kLogName_Tee, CRequestRateControl::kNoLimit, kRootLog, NCBI_LSAN_DISABLE_GUARD, CDirEntry::NormalizePath(), NStr::NumericToString(), OpenLogFileFromConfig(), s_GetLogConfigBool(), s_GetLogConfigString(), s_LogSizeLimit, CDiagContext::SetApplogSeverityLocked(), SetDiagHandler(), SetDiagPostLevel(), SetDiagStream(), SetLogFile(), and Warning().
Referenced by CNcbiApplicationAPI::AppMain(), InitDiagHandler(), CNcbiApplicationAPI::SetupDiag(), CNcbiApplicationAPI::SetupDiag_AppSpecific(), CDiagContext::SetUseRootLog(), and CNcbiApplicationAPI::x_TryInit().
Set username.
Definition at line 1760 of file ncbidiag.cpp.
References CDiagContext::m_Username.
Referenced by SetDiagUserAndHost(), and CDiagContext::SetProperty().
|
static |
@depracated The flag is always set now, the funcion still calls SetupDiag() for compatibility, but has no other effects.
Definition at line 3493 of file ncbidiag.cpp.
References s_FinishedSetupDiag, and CDiagContext::SetupDiag().
|
inline |
Definition at line 835 of file ncbidiag.hpp.
Get a common symbolic name for the severity levels.
Referenced by CJsonResponse::AddMessage(), CPSGS_CassProcessorBase::CountError(), CFlatFileMessage::Dump(), CAnnotWriterLogger::DumpMessage(), CMessageHandlerDefault::HandleMessage(), 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().
|
inline |
Activate 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().
|
inline |
Activate and start (or, restart after Suspend()) the timer.
Definition at line 551 of file perf_log.hpp.
References CPerfLogGuard::m_Logger, and CPerfLogger::Start().
|
private |
Definition at line 337 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::UnsetRequestStatus(), CRequestContext::x_CanModify(), CRequestContext::x_LoadEnvContextProperties(), and CRequestContext::x_LogHitID().
|
private |
Definition at line 355 of file request_ctx.cpp.
References CDiagContext::eHitID_NoCreate, CRequestContext::fLoggedOnRequest, CRequestContext::m_HitIDLoggedFlag, CRequestContext::m_IsRunning, CRequestContext::m_Tracer, CRequestContext::Reset(), CRequestContext::x_CanModify(), and CRequestContext::x_GetHitID().
Get severity from string.
str_sev | Can be the numeric value or a symbolic name (see CDiagBuffer::sm_SeverityName[]). |
sev | Severity level. |
Definition at line 7904 of file ncbidiag.cpp.
References NStr::CompareNocase(), eDiagSevMax, eDiagSevMin, CNcbiDiag::SeverityName(), and NStr::StringToNonNegativeInt().
Referenced by CNcbiApplicationAPI::AppMain(), SDiagMessage::ParseMessage(), s_ParseErrCodeInfoStr(), NParamsBuilder::SBase< SPerformanceParams >::SBase(), CNcbiApplicationAPI::x_HonorStandardSettings(), and CNcbiEncrypt::x_LoadKeys().
|
inline |
Suspend 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().
|
inline |
Suspend the timer.
Call Start() to continue to count time accured before.
Definition at line 558 of file perf_log.hpp.
References CPerfLogGuard::m_Logger, and CPerfLogger::Suspend().
Definition at line 777 of file request_ctx.cpp.
References NStr::fSplit_MergeDelimiters, ITERATE, CRequestContext::sm_ContextFields, NStr::Split(), and CRequestContext::sx_NormalizeContextPropertyName().
Referenced by CRequestContext::AddPassThroughProperty(), and CRequestContext::x_LoadEnvContextProperties().
|
staticprivate |
Definition at line 370 of file request_ctx.cpp.
Referenced by CRequestContext::GetDefaultAutoIncRequestIDOnPost(), and CRequestContext::SetDefaultAutoIncRequestIDOnPost().
Definition at line 802 of file request_ctx.cpp.
References NStr::Replace().
Referenced by CRequestContext::AddPassThroughProperty(), CRequestContext::sx_GetContextFieldsMask(), and CRequestContext::x_LoadEnvContextProperties().
|
staticprivate |
Definition at line 940 of file ncbidiag.cpp.
References eDeinitialized, CDiagLock::eWrite, GetDiagContext(), CThread::IsMain(), CDiagContext::IsSetOldPostFormat(), CDiagContext::PrintStop(), s_FinishedSetupDiag, s_ThreadDataState(), and rapidjson::value.
Referenced by CDiagContextThreadData::GetThreadData().
|
inline |
Definition at line 878 of file request_ctx.hpp.
References CRequestContext::eProp_BytesRd, CRequestContext::m_BytesRd, CRequestContext::x_CanModify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset().
|
inline |
Definition at line 907 of file request_ctx.hpp.
References CRequestContext::eProp_BytesWr, CRequestContext::m_BytesWr, CRequestContext::x_CanModify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset().
|
inline |
Definition at line 693 of file request_ctx.hpp.
References CRequestContext::eProp_ClientIP, CRequestContext::m_ClientIP, CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset().
void UnsetDiagPostFlag | ( | EDiagPostFlag | flag | ) |
Unset the specified flag (globally).
Definition at line 6075 of file ncbidiag.cpp.
References s_UnsetDiagPostFlag().
Referenced by CGridCommandLineInterfaceApp::Run().
void UnsetDiagTraceFlag | ( | EDiagPostFlag | flag | ) |
Definition at line 6091 of file ncbidiag.cpp.
References s_UnsetDiagPostFlag().
Referenced by Cn3DApp::Cn3DApp(), Cn3DNoWin::Init(), and main().
|
inline |
Definition at line 814 of file request_ctx.hpp.
References CRequestContext::eProp_Dtab, CRequestContext::x_CanModify(), and CRequestContext::x_UnsetProp().
|
inline |
Reset explicit hit id.
Definition at line 762 of file request_ctx.hpp.
References CRequestContext::eProp_HitID, kEmptyStr, CRequestContext::m_HitID, CRequestContext::m_HitIDLoggedFlag, CRequestContext::m_SubHitIDCache, CSharedHitId::SetHitId(), CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset().
Remove property from the map.
Definition at line 308 of file request_ctx.cpp.
References map_checker< Container >::erase(), CRequestContext::m_Properties, and CRequestContext::x_CanModify().
|
inline |
Reset request ID.
Definition at line 663 of file request_ctx.hpp.
References CRequestContext::eProp_RequestID, CRequestContext::m_RequestID, CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset().
|
inline |
Definition at line 849 of file request_ctx.hpp.
References CRequestContext::eProp_ReqStatus, CRequestContext::m_ReqStatus, CRequestContext::x_CanModify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset(), CDiagContext::SetProperty(), and CRequestContext::StartRequest().
|
inline |
Definition at line 735 of file request_ctx.hpp.
References CRequestContext::eProp_SessionID, kEmptyStr, CRequestContext::m_SessionID, CEncodedString::SetString(), CRequestContext::x_CanModify(), CRequestContext::x_Modify(), and CRequestContext::x_UnsetProp().
Referenced by CRequestContext::Reset().
|
static |
Update diagnostics after fork().
Updates PID if necessary (in the child process). If PID has not changed (parent process), no other actions are performed. For this reason the method will not do anything after the first call, since no PID changes will be detected.
Definition at line 824 of file logging.cpp.
References CDiagContext::UpdatePID().
Referenced by CCurrentProcess::Fork().
|
static |
Reset PID cache (e.g. after fork). Return true if PID was updated.
Definition at line 830 of file logging.cpp.
References i, NULL, CSrvDiagMsg::PrintExtra(), CSrvDiagMsg::PrintParam(), s_AppUID, s_InitConstants(), s_InitLogPrefix(), s_MainData, s_MaxRunningThreads, s_Threads, and thr.
Referenced by CFileHandleDiagHandler::Reopen(), and CDiagContext::UpdateOnFork().
|
static |
Definition at line 1555 of file ncbidiag.cpp.
References GetDiagContext(), CCurrentProcess::GetPid(), CDiagContext::sm_PID, and CDiagContext::x_CreateUID_AsyncSafe().
CDiagContext::TUID CDiagContext::UpdateUID | ( | TUID | uid = 0 | ) | const |
Take the source UID and replace its timestamp part with the current time.
If the source UID is 0, use the one from the diag context.
Definition at line 1702 of file ncbidiag.cpp.
References CDiagContext::GetUID(), and t.
Switch printing system TID (rather than CThread::GetSelf()) on/off.
Definition at line 3364 of file ncbidiag.cpp.
References s_PrintSystemTID, and rapidjson::value.
|
inline |
Definition at line 2660 of file ncbidiag.hpp.
References eDiagFile_Perf, CFileHandleDiagHandler::m_FileType, CFileHandleDiagHandler::m_Handle, CFileHandleDiagHandler::m_HavePosts, and CFileHandleDiagHandler::m_LowDiskSpace.
CNcbiOstream & SDiagMessage::Write | ( | CNcbiOstream & | os, |
TDiagWriteFlags | fl = fNone |
||
) | const |
Write to stream.
Definition at line 1350 of file logging.cpp.
References buf, ExtractFileName(), file, flags, SDiagMessage::fNoEndl, len, NcbiEndl, prefix, s_ConvertSeverity(), s_SevNames, and string.
void SDiagMessage::Write | ( | string & | str, |
TDiagWriteFlags | flags = fNone |
||
) | const |
Binary OR of "EDiagWriteFlags".
Write to string.
Definition at line 5355 of file ncbidiag.cpp.
Referenced by DisplayDiagnostic(), operator<<(), CBlastAppDiagHandler::Post(), CSysLog::Post(), CCommentDiagHandler::Post(), CTable2AsnLogger::Post(), CPythonDiagHandler::Post(), CExceptionReporterStream::Report(), and CException::ReportStd().
|
virtual |
Write string to the log.
The string may contain multiple messages of the same type.
Reimplemented in CFileDiagHandler, and CFileHandleDiagHandler.
Definition at line 6396 of file ncbidiag.cpp.
References _ASSERT.
Referenced by CAsyncDiagThread::Main().
|
virtual |
Write string to the log.
The string may contain multiple messages of the same type.
Reimplemented from CDiagHandler.
Definition at line 6676 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.
|
virtual |
Write string to the log.
The string may contain multiple messages of the same type.
Reimplemented from CDiagHandler.
Definition at line 7143 of file ncbidiag.cpp.
References buf, CStopWatch::Elapsed(), CDiagHandler::fDefault, file_type, CStopWatch::IsRunning(), kLogReopenDelay, len, CFileDiagHandler::m_ReopenTimer, CFileDiagHandler::Reopen(), s_ReopenEntered, and CFileDiagHandler::x_GetHandler().
void CDiagContext::WriteStdPrefix | ( | CNcbiOstream & | ostr, |
const SDiagMessage & | msg | ||
) | const |
Write standard prefix to the stream.
Use values from the message (PID/TID/RID etc.).
Definition at line 3163 of file ncbidiag.cpp.
References CTime::AsString(), client, SDiagMessage::GetAppName(), SDiagMessage::GetAppState(), SDiagMessage::GetClient(), SDiagMessage::GetHost(), SDiagMessage::GetSession(), CDiagContext::GetStringUID(), SDiagMessage::GetTime(), SDiagMessage::GetUID(), 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, SDiagMessage::m_PID, SDiagMessage::m_ProcPost, SDiagMessage::m_RequestId, SDiagMessage::m_ThrPost, SDiagMessage::m_TID, and s_AppStateToStr().
Referenced by SDiagMessage::x_NewWrite().
|
inlineprivate |
Definition at line 947 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().
|
private |
Definition at line 2444 of file ncbidiag.cpp.
References SDiagMessage::eEvent_Extra, ERR_POST_ONCE, CDiagContext_Extra::m_EventType, and CDiagContext_Extra::m_Flushed.
Referenced by CDiagContext_Extra::Print().
|
inlineprivate |
Definition at line 484 of file perf_log.hpp.
References ERR_POST_ONCE, Error(), and CPerfLogger::m_IsDiscarded.
Referenced by CPerfLogger::Post(), CPerfLogger::Start(), and CPerfLogger::Suspend().
|
private |
Definition at line 239 of file syslog.cpp.
References CSysLog::fNoOverride, CSysLog::m_DefaultFacility, CSysLog::m_Flags, CSysLog::m_Ident, NULL, CSysLog::sm_Current, and CSysLog::x_TranslateFlags().
Referenced by CSysLog::CSysLog(), and CSysLog::Post().
|
private |
Definition at line 1624 of file ncbidiag.cpp.
References CDiagContext::GetHost(), kUID_InitBase, kUID_Mult, CDiagContext::m_UID, and s_CreateUID().
Referenced by CDiagContext::GetUID(), and CDiagContext::x_CreateUID_AsyncSafe().
|
private |
Definition at line 1634 of file ncbidiag.cpp.
References buf, CDiagContext::GetPID(), kUID_InitBase, kUID_Mult, CDiagContext::m_UID, s_CreateUID(), and CDiagContext::x_CreateUID().
Referenced by CDiagContext::UpdatePID_AsyncSafe().
|
private |
Definition at line 883 of file request_ctx.cpp.
References data, CRequestContext_PassThrough::m_Context, CRequestContext::m_PassThroughProperties, and CStringPairs< TContainer >::Parse().
Referenced by CRequestContext_PassThrough::Deserialize().
|
private |
Definition at line 2959 of file ncbidiag.cpp.
References eDiagAppState_AppBegin, eDiagAppState_AppEnd, eDiagAppState_AppRun, and CDiagContext::GetAppState().
Referenced by CDiagContext::x_LogHitID().
|
private |
Private replacement for Endm called from manipulators.
Unlike Endm, does not reset ErrCode if buffer is not set.
|
static |
Internal function, should be used only by CNcbiApplication.
Definition at line 3501 of file ncbidiag.cpp.
References _ASSERT, and s_FinishedSetupDiag.
Referenced by CNcbiApplicationAPI::x_TryInit().
|
private |
Definition at line 2997 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::GetDefaultHitID(), CDiagContext::PrintStart(), and CRequestContext::x_GetHitID().
|
private |
Definition at line 7067 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(), SDiagMessage::m_Event, SDiagMessage::m_Flags, and SDiagMessage::m_Severity.
Referenced by CFileDiagHandler::AllowAsyncWrite(), CFileDiagHandler::ComposeMessage(), and CFileDiagHandler::Post().
|
private |
Definition at line 7088 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().
|
private |
Definition at line 226 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().
string SDiagMessage::x_GetModule | ( | void | ) | const |
Definition at line 5373 of file ncbidiag.cpp.
References CDirEntry::GetPathSeparator(), kEmptyStr, SDiagMessage::m_File, SDiagMessage::m_Module, string, NStr::ToUpper(), and SDiagMessage::x_IsSetOldFormat().
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
Definition at line 1721 of file ncbidiag.cpp.
References CAtomicCounter::Add(), buf, CDiagContextThreadData::GetRequestContext(), CRequestContext::GetRequestID(), CDiagContextThreadData::GetThreadData(), CDiagContextThreadData::GetTID(), CDiagContext::GetUID(), and string.
Referenced by CDiagContext::GetNextHitID(), and CDiagContext::x_GetDefaultHitID().
|
private |
Definition at line 638 of file request_ctx.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), kEmptyStr, CRequestContext::m_PassThroughProperties, and CRequestContext::x_UpdateStdPassThroughProp().
Referenced by CRequestContext_PassThrough::Get(), and CRequestContext::x_UpdateStdContextProp().
|
private |
Definition at line 538 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().
|
private |
Definition at line 5915 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().
|
private |
Definition at line 2990 of file ncbidiag.cpp.
References CDiagContext::m_DefaultHitId.
Referenced by CDiagContext::PrintStop().
|
inlineprivate |
Definition at line 5348 of file ncbidiag.cpp.
References SDiagMessage::eFormat_Auto, SDiagMessage::eFormat_Old, GetDiagContext(), CDiagContext::IsSetOldPostFormat(), and SDiagMessage::m_Format.
Referenced by SDiagMessage::x_GetModule().
|
private |
Definition at line 630 of file request_ctx.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CRequestContext::m_PassThroughProperties, and CRequestContext::x_UpdateStdPassThroughProp().
Referenced by CRequestContext_PassThrough::IsSet(), and CRequestContext::x_UpdateStdContextProp().
Definition at line 916 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().
|
private |
Definition at line 808 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().
|
staticprivate |
Definition at line 3221 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().
Definition at line 197 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().
|
private |
Definition at line 2968 of file ncbidiag.cpp.
References eNcbiStrings_PHID, CDiagContext::Extra(), g_GetNcbiString(), CDiagContext::m_DefaultHitId, CDiagContext::m_LoggedHitId, CDiagContext_Extra::Print(), and CDiagContext::x_DiagAtApplicationLevel().
Referenced by CDiagContext::SetDefaultHitID(), CDiagContext::x_GetDefaultHitID(), and CDiagContext::x_LogHitID_WithLock().
|
private |
Definition at line 2983 of file ncbidiag.cpp.
References CDiagContext::x_LogHitID().
Referenced by CDiagContext::PrintRequestStop(), and CDiagContext::PrintStop().
|
inlineprivate |
Definition at line 936 of file request_ctx.hpp.
References CSharedHitId::Empty(), CRequestContext::fLoggedOnError, CRequestContext::m_HitID, and CRequestContext::m_HitIDLoggedFlag.
|
private |
Definition at line 3921 of file ncbidiag.cpp.
References NStr::eNocase, ITERATE, CNcbiLogFields::m_Fields, CNcbiLogFields::m_Source, NStr::MatchesMask(), CDiagContext_Extra::Print(), and rapidjson::value.
Referenced by CNcbiLogFields::LogFields().
|
inlineprivate |
Definition at line 958 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().
|
private |
Definition at line 697 of file ncbidiag.cpp.
References CDiagCompileInfo::m_File, NULL, and util::strcmp().
Referenced by CDiagCompileInfo::CDiagCompileInfo().
CNcbiOstream & SDiagMessage::x_NewWrite | ( | CNcbiOstream & | os, |
TDiagWriteFlags | fl = fNone |
||
) | const |
Definition at line 5758 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().
CNcbiOstream & SDiagMessage::x_OldWrite | ( | CNcbiOstream & | os, |
TDiagWriteFlags | fl = fNone |
||
) | const |
Definition at line 5570 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().
Definition at line 4843 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().
|
private |
Definition at line 3274 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_ONCE, CNcbiDiag::ForceImportantFlags(), CDiagContext::GetExitCode(), CDiagContext::GetExitSignal(), CDiagContext::GetRequestContext(), CDiagContext::IsSetOldPostFormat(), kApplogDiagPostFlags, SDiagMessage::m_Event, CDiagContext::m_StopWatch, NULL, s_DisableAppLog, str(), and CDiagContext::x_StartRequest().
Referenced by CDiagContext::PrintExtra(), CDiagContext::PrintProperties(), CDiagContext::PrintRequestStart(), CDiagContext::PrintRequestStop(), CDiagContext::PrintStart(), CDiagContext::PrintStop(), and CDiagContext::SetProperty().
|
private |
Helper func for the exception-related Put()
Definition at line 7817 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().
|
private |
Definition at line 2408 of file ncbidiag.cpp.
References CDiagContext_Extra::Flush(), CDiagContext_Extra::m_Args, and CDiagContext_Extra::m_Counter.
Referenced by CDiagContext_Extra::operator=(), and CDiagContext_Extra::~CDiagContext_Extra().
|
private |
Definition at line 6760 of file ncbidiag.cpp.
References _ASSERT, CFileDiagHandler::m_Err, CFileDiagHandler::m_Log, CFileDiagHandler::m_OwnErr, CFileDiagHandler::m_OwnLog, CFileDiagHandler::m_OwnPerf, CFileDiagHandler::m_OwnTrace, CFileDiagHandler::m_Perf, and CFileDiagHandler::m_Trace.
Referenced by CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 656 of file request_ctx.cpp.
References map_checker< Container >::end(), map_checker< Container >::erase(), map_checker< Container >::find(), CRequestContext::m_PassThroughProperties, CRequestContext::x_CanModify(), and CRequestContext::x_UpdateStdContextProp().
Referenced by CRequestContext_PassThrough::Reset(), and CRequestContext::x_UpdateStdPassThroughProp().
|
private |
Definition at line 5951 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=().
|
private |
Definition at line 876 of file request_ctx.cpp.
References NStr::eUrlEnc_Cookie, CRequestContext_PassThrough::m_Context, CRequestContext::m_PassThroughProperties, and CStringPairs< TContainer >::Merge().
Referenced by CRequestContext_PassThrough::Serialize().
|
inlineprivate |
Definition at line 1743 of file ncbidiag.hpp.
References SDiagMessage::m_Format.
|
private |
Definition at line 6798 of file ncbidiag.cpp.
References 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_ResetHandler().
Referenced by CFileDiagHandler::SetLogFile(), and CFileDiagHandler::SetSubHandler().
|
private |
Definition at line 392 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().
Set 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().
|
private |
Definition at line 646 of file request_ctx.cpp.
References CRequestContext::m_PassThroughProperties, rapidjson::value, CRequestContext::x_CanModify(), and CRequestContext::x_UpdateStdContextProp().
Referenced by CRequestContext_PassThrough::Set(), and CRequestContext::x_UpdateStdPassThroughProp().
|
inlineprivate |
Definition at line 923 of file request_ctx.hpp.
References CRequestContext::m_PropSet.
Referenced by CRequestContext::SetBytesRd(), CRequestContext::SetBytesWr(), CRequestContext::SetClientIP(), CRequestContext::SetDtab(), CRequestContext::SetRequestID(), CRequestContext::SetRequestStatus(), CRequestContext::SetSessionID(), and CRequestContext::x_SetHitID().
|
staticprivate |
Definition at line 3197 of file ncbidiag.cpp.
References ctx, ERR_POST_ONCE, CDiagContext::GetDefaultClientIP(), CDiagContext::GetRequestContext(), ip, and CDiagContext::x_LogEnvironment().
Referenced by CDiagContext_Extra::Flush(), and CDiagContext::x_PrintMessage().
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().
Definition 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().
|
inlineprivate |
Definition at line 929 of file request_ctx.hpp.
References CRequestContext::m_PropSet.
Referenced by CRequestContext::UnsetBytesRd(), CRequestContext::UnsetBytesWr(), CRequestContext::UnsetClientIP(), CRequestContext::UnsetDtab(), CRequestContext::UnsetHitID(), CRequestContext::UnsetRequestID(), CRequestContext::UnsetRequestStatus(), and CRequestContext::UnsetSessionID().
|
private |
Definition at line 708 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().
|
private |
Definition at line 667 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().
|
private |
Definition at line 424 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(), prefix, CDiagContext_Extra::Print(), and CRequestContext::x_Modify().
Referenced by CRequestContext::GetCurrentSubHitID(), and CRequestContext::GetNextSubHitID().
|
virtual |
Definition at line 7213 of file ncbidiag.cpp.
References _ASSERT, and CAsyncDiagHandler::m_AsyncThread.
CDiagAutoPrefix::~CDiagAutoPrefix | ( | void | ) |
Remove the prefix automagically, when the object gets out of scope.
Definition at line 6019 of file ncbidiag.cpp.
References PopDiagPostPrefix().
CDiagCollectGuard::~CDiagCollectGuard | ( | void | ) |
Destroy the guard, return post level to the one set before the guard initialization.
Depending on the currently set action print or discard the messages. On ePrint all collected messages are printed (if there is no higher level guard) and removed from the collection. On eDiscard the messages are silently discarded (only when the last of several nested guards is destroyed).
Definition at line 569 of file ncbidiag.cpp.
References CDiagCollectGuard::Release().
CDiagCompileInfo::~CDiagCompileInfo | ( | void | ) |
Definition at line 1332 of file logging.cpp.
References CDiagCompileInfo::m_StrCurrFunctName, and CDiagCompileInfo::m_StrFile.
CDiagContext::~CDiagContext | ( | void | ) |
Definition at line 1337 of file ncbidiag.cpp.
References NULL, and CDiagContext::sm_Instance.
CDiagContext_Extra::~CDiagContext_Extra | ( | void | ) |
Prints all arguments as "name1=value1&name2=value2...".
Definition at line 2436 of file ncbidiag.cpp.
References CDiagContext_Extra::m_Counter, and CDiagContext_Extra::x_Release().
CDiagErrCodeInfo::~CDiagErrCodeInfo | ( | void | ) |
Destructor.
|
inlinevirtual |
Definition at line 2927 of file ncbidiag.hpp.
|
inlinevirtual |
Destructor.
Definition at line 2447 of file ncbidiag.hpp.
CDiagRestorer::~CDiagRestorer | ( | void | ) |
Restores captured settings.
Definition at line 8004 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 | ( | void | ) |
Definition at line 6742 of file ncbidiag.cpp.
References 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, and CFileDiagHandler::x_ResetHandler().
CFileHandleDiagHandler::~CFileHandleDiagHandler | ( | void | ) |
Close file handle.
Definition at line 6503 of file ncbidiag.cpp.
References CFileHandleDiagHandler::m_Handle, CFileHandleDiagHandler::m_HandleLock, CFileHandleDiagHandler::m_ReopenTimer, and CObject::RemoveReference().
CJaegerTracer::~CJaegerTracer | ( | void | ) |
Definition at line 108 of file jaeger_tracer.cpp.
CNcbiDiag::~CNcbiDiag | ( | void | ) |
CNcbiLogFields::~CNcbiLogFields | ( | void | ) |
Definition at line 3916 of file ncbidiag.cpp.
|
inline |
If the timer is still active, then post an error (once).
Usually each measurement should be finished with calling Post() or Discard() method.
Definition at line 475 of file perf_log.hpp.
References ERR_POST_ONCE, Error(), CStopWatch::eStop, CPerfLogger::IsON(), CPerfLogger::m_IsDiscarded, and CPerfLogger::m_TimerState.
|
inline |
If Post() or Discard() have not been called, then log the collected info with status 500.
Definition at line 538 of file perf_log.hpp.
References CRequestStatus::e500_InternalServerError, CPerfLogger::m_IsDiscarded, CPerfLogGuard::m_Logger, and CPerfLogGuard::Post().
|
virtual |
Definition at line 185 of file request_ctx.cpp.
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 922 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().
|
inline |
Definition at line 75 of file request_ctx.hpp.
CSysLog::~CSysLog | ( | ) |
Definition at line 88 of file syslog.cpp.
References NULL, and CSysLog::sm_Current.
|
inlinevirtual |
Definition at line 1578 of file ncbidiag.hpp.
|
inlinevirtual |
Definition at line 144 of file request_ctx.hpp.
|
inlinevirtual |
Definition at line 153 of file request_ctx.hpp.
SDiagMessage::~SDiagMessage | ( | void | ) |
Definition at line 4574 of file ncbidiag.cpp.
References SDiagMessage::m_Data.
const char* SNcbiLog_Param::key |
Definition at line 276 of file ncbi_c_log.h.
Referenced by NcbiLog_AppRun(), NcbiLog_ReqStart(), s_AddParamsPair(), s_LogHitID(), s_LogSubHitID(), s_PrintParams(), and s_PrintReqStartExtraParams().
|
static |
Definition at line 110 of file syslog.hpp.
Referenced by CSysLog::GetLogName(), and CDiagContext::SetupDiag().
|
static |
Definition at line 2055 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().
|
static |
Per-thread properties.
Definition at line 2059 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2064 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2065 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2060 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2057 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2056 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2054 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2053 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2062 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2063 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Definition at line 2061 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), and CDiagContext::SetProperty().
|
static |
Global properties.
Definition at line 2052 of file ncbidiag.hpp.
Referenced by CDiagContext::GetProperty(), IsGlobalProperty(), and CDiagContext::SetProperty().
|
private |
Definition at line 1384 of file ncbidiag.hpp.
Referenced by CDiagCollectGuard::GetAction(), CDiagCollectGuard::SetAction(), and CDiagCollectGuard::x_Init().
|
private |
Definition at line 179 of file perf_log.hpp.
Referenced by CPerfLogger::Adjust(), CPerfLogger::CPerfLogger(), CPerfLogger::GetElapsedTime(), and CPerfLogger::Post().
|
private |
Definition at line 1758 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), SDiagMessage::FormatExtraMessage(), and SDiagMessage::operator=().
|
private |
Definition at line 1926 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::AllowBadSymbolsInArgNames(), CDiagContext_Extra::Flush(), and CDiagContext_Extra::operator=().
|
private |
Definition at line 2377 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), CDiagContext::ResetLogRates(), CDiagContext::SetLogRate_Limit(), and CDiagContext::SetLogRate_Period().
|
private |
Limiting applog post level?
Definition at line 2983 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 2380 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), CDiagContext::ResetLogRates(), CDiagContext::SetLogRate_Limit(), and CDiagContext::SetLogRate_Period().
|
private |
Definition at line 2358 of file ncbidiag.hpp.
Referenced by CDiagContext::GetAppName(), CDiagContext::GetEncodedAppName(), and CDiagContext::SetAppName().
|
mutableprivate |
Definition at line 2359 of file ncbidiag.hpp.
Referenced by CDiagContext::GetAppName(), CDiagContext::GetEncodedAppName(), and CDiagContext::SetAppName().
|
private |
Definition at line 2366 of file ncbidiag.hpp.
Referenced by CDiagContext::GetGlobalAppState(), CDiagContext::SetAppState(), and CDiagContext::SetGlobalAppState().
|
private |
Definition at line 134 of file request_ctx.hpp.
Referenced by CSharedHitId::IsRequestLevel(), and CSharedHitId::SetHitId().
|
private |
Definition at line 466 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetAppState(), CRequestContext::Reset(), CRequestContext::SetAppState(), and CRequestContext::x_LogHitID().
|
private |
Definition at line 1919 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::CDiagContext_Extra(), CDiagContext_Extra::Flush(), CDiagContext_Extra::operator=(), CDiagContext_Extra::Print(), and CDiagContext_Extra::x_Release().
|
private |
Thread handling all physical printing of log messages.
Definition at line 2831 of file ncbidiag.hpp.
Referenced by CAsyncDiagHandler::GetLogName(), CAsyncDiagHandler::InstallToDiag(), CAsyncDiagHandler::Post(), CAsyncDiagHandler::RemoveFromDiag(), CAsyncDiagHandler::Reopen(), and CAsyncDiagHandler::~CAsyncDiagHandler().
|
private |
Definition at line 479 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetAutoIncRequestIDOnPost(), and CRequestContext::SetAutoIncRequestIDOnPost().
|
private |
This thread's error msg. buffer.
Definition at line 1210 of file ncbidiag.hpp.
Referenced by CNcbiDiag::x_Put(), and CNcbiDiag::~CNcbiDiag().
const char* SDiagMessage::m_Buffer |
Not guaranteed to be '\0'-terminated!
Definition at line 1652 of file ncbidiag.hpp.
Referenced by ncbi::CNcbiToolkit_LogMessage::Message(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CPythonDiagHandler::Post(), CwxLogDiagHandler::Post(), CWindowsCmdErrorHandler::Post(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
size_t SDiagMessage::m_BufferLen |
Length of m_Buffer.
Definition at line 1653 of file ncbidiag.hpp.
Referenced by ncbi::CNcbiToolkit_LogMessage::Message(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CPythonDiagHandler::Post(), CwxLogDiagHandler::Post(), CWindowsCmdErrorHandler::Post(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
Definition at line 474 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetBytesRd(), CRequestContext::SetBytesRd(), and CRequestContext::UnsetBytesRd().
|
private |
Definition at line 475 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetBytesWr(), CRequestContext::SetBytesWr(), and CRequestContext::UnsetBytesWr().
|
private |
Can delete err code info?
Definition at line 2982 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Can handler be deleted?
Definition at line 2980 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 889 of file ncbidiag.hpp.
const char* SDiagMessage::m_Class |
Class name.
Definition at line 1656 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
mutableprivate |
Definition at line 116 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::ParseCurrFunctName(), CDiagCompileInfo::SetClass(), and CDiagCompileInfo::SetFunction().
|
mutableprivate |
Definition at line 115 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::SetClass(), and CDiagCompileInfo::SetFunction().
|
private |
Definition at line 467 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetClientIP(), CRequestContext::SetClientIP(), and CRequestContext::UnsetClientIP().
int ErrCode::m_Code |
|
private |
Definition at line 1382 of file ncbidiag.hpp.
Referenced by CDiagCollectGuard::GetCollectSeverity(), CDiagCollectGuard::SetCollectSeverity(), and CDiagCollectGuard::x_Init().
|
mutableprivate |
Definition at line 1214 of file ncbidiag.hpp.
Referenced by CNcbiDiag::SetClass(), CNcbiDiag::SetFile(), CNcbiDiag::SetFunction(), and CNcbiDiag::SetModule().
|
private |
Definition at line 562 of file request_ctx.hpp.
Referenced by CRequestContext_PassThrough::CRequestContext_PassThrough(), CRequestContext_PassThrough::Deserialize(), CRequestContext_PassThrough::Enumerate(), CRequestContext_PassThrough::Get(), CRequestContext_PassThrough::IsSet(), CRequestContext_PassThrough::Reset(), CRequestContext_PassThrough::Serialize(), CRequestContext_PassThrough::Set(), CRequestContext_PassThrough::x_DeserializeUrlEncoded(), and CRequestContext_PassThrough::x_SerializeUrlEncoded().
|
private |
Definition at line 1920 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::operator=(), CDiagContext_Extra::x_Release(), and CDiagContext_Extra::~CDiagContext_Extra().
|
private |
Definition at line 113 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::CDiagCompileInfo(), CDiagCompileInfo::ParseCurrFunctName(), and CDiagCompileInfo::SetFunction().
|
mutableprivate |
Definition 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().
|
private |
Definition at line 123 of file syslog.hpp.
Referenced by CSysLog::HonorRegistrySettings(), CSysLog::x_Connect(), and CSysLog::x_TranslateFacility().
|
mutableprivate |
Definition at line 2361 of file ncbidiag.hpp.
Referenced by CDiagContext::SetDefaultHitID(), CDiagContext::x_GetDefaultHitID(), CDiagContext::x_IsSetDefaultHitID(), and CDiagContext::x_LogHitID().
|
mutableprivate |
Definition at line 2360 of file ncbidiag.hpp.
Referenced by CDiagContext::SetDefaultSessionID().
|
private |
Die level severity.
Definition at line 2976 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 470 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetDtab(), and CRequestContext::SetDtab().
|
private |
Definition at line 180 of file perf_log.hpp.
Referenced by CPerfLogger::CPerfLogger(), CPerfLogger::GetElapsedTime(), CPerfLogger::Post(), and CPerfLogger::Suspend().
|
private |
Definition at line 2774 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::GetLogFile(), CFileDiagHandler::GetLogStream(), CFileDiagHandler::Reopen(), CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_GetHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
mutableprivate |
Error code.
Definition at line 1208 of file ncbidiag.hpp.
int SDiagMessage::m_ErrCode |
Error code.
Definition at line 1659 of file ncbidiag.hpp.
Referenced by ncbi::CNcbiToolkit_LogMessage::ErrCode(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CWindowsCmdErrorHandler::Post(), SDiagMessage::SDiagMessage(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
Error code information.
Definition at line 2981 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 2378 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), CDiagContext::ResetLogRates(), CDiagContext::SetLogRate_Limit(), and CDiagContext::SetLogRate_Period().
|
private |
Definition at line 2381 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), CDiagContext::ResetLogRates(), CDiagContext::SetLogRate_Limit(), and CDiagContext::SetLogRate_Period().
|
private |
Definition at line 606 of file request_ctx.hpp.
Referenced by CRequestContextGuard_Base::SetDefaultErrorStatus(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
|
mutableprivate |
Error subcode.
Definition at line 1209 of file ncbidiag.hpp.
int SDiagMessage::m_ErrSubCode |
Sub Error code.
Definition at line 1660 of file ncbidiag.hpp.
Referenced by ncbi::CNcbiToolkit_LogMessage::ErrSubCode(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
const char* SDiagMessage::m_ErrText |
Sometimes 'error' has no numeric code, but can be represented as text.
Definition at line 1663 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
EEventType SDiagMessage::m_Event |
If the severity is eDPF_AppLog, m_Event contains event type.
Definition at line 1672 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CFileDiagHandler::x_GetDiagFileType(), SDiagMessage::x_NewWrite(), and CDiagContext::x_PrintMessage().
|
private |
Definition at line 1918 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), and CDiagContext_Extra::x_CanPrint().
|
private |
Definition at line 2363 of file ncbidiag.hpp.
Referenced by CDiagContext::GetExitCode(), CDiagContext::GetProperty(), and CDiagContext::SetExitCode().
|
private |
Definition at line 2364 of file ncbidiag.hpp.
Referenced by CDiagContext::IsSetExitCode(), and CDiagContext::SetExitCode().
|
private |
Definition at line 2365 of file ncbidiag.hpp.
Referenced by CDiagContext::GetExitSignal(), CDiagContext::GetProperty(), and CDiagContext::SetExitSignal().
string SDiagErrCodeDescription::m_Explanation |
Error message (with detailed explanation)
Definition at line 3014 of file ncbidiag.hpp.
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
TExtraArgs SDiagMessage::m_ExtraArgs |
If event type is "extra", contains the list of arguments.
Definition at line 1678 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), SDiagMessage::FormatExtraMessage(), SDiagMessage::operator=(), CPythonDiagHandler::Post(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_ParseExtraArgs().
|
private |
Definition at line 2423 of file ncbidiag.hpp.
Referenced by CNcbiLogFields::CNcbiLogFields(), and CNcbiLogFields::x_Match().
|
private |
Definition at line 109 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::CDiagCompileInfo(), CDiagCompileInfo::SetFile(), and CDiagCompileInfo::x_NeedModule().
const char* SDiagMessage::m_File |
File name.
Definition at line 1654 of file ncbidiag.hpp.
Referenced by ncbi::CNcbiToolkit_LogMessage::File(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CwxLogDiagHandler::Post(), CWindowsCmdErrorHandler::Post(), SDiagMessage::SDiagMessage(), SDiagMessage::x_GetModule(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
Definition at line 2674 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::Valid().
|
private |
Definition at line 181 of file perf_log.hpp.
Referenced by CPerfLogger::CPerfLogger(), CPerfLogger::GetLoggerStartTime(), CPerfLogger::Post(), and CPerfLogger::Start().
TDiagPostFlags SetPostFlags::m_Flags |
flags to set
Definition at line 852 of file ncbidiag.hpp.
TDiagPostFlags SDiagMessage::m_Flags |
Bitwise OR of "EDiagPostFlag".
Definition at line 1661 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CTeeDiagHandler::Post(), CTable2AsnLogger::Post(), SDiagMessage::SDiagMessage(), CFileDiagHandler::x_GetDiagFileType(), SDiagMessage::x_NewWrite(), SDiagMessage::x_OldWrite(), and CNcbiDiag::x_Put().
|
private |
Definition at line 480 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), and CRequestContext::StartRequest().
|
private |
Definition at line 605 of file request_ctx.hpp.
Referenced by CRequestContextGuard_Base::CRequestContextGuard_Base().
|
private |
Definition at line 122 of file syslog.hpp.
Referenced by CSysLog::HonorRegistrySettings(), CSysLog::Post(), and CSysLog::x_Connect().
|
private |
Definition at line 1925 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), CDiagContext_Extra::operator=(), and CDiagContext_Extra::x_CanPrint().
|
mutableprivate |
Definition at line 1753 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::x_IsSetOldFormat(), and SDiagMessage::x_SetFormat().
|
private |
Definition at line 907 of file ncbidiag.hpp.
const char* SDiagMessage::m_Function |
Function name.
Definition at line 1657 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
mutableprivate |
Definition at line 117 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::ParseCurrFunctName(), and CDiagCompileInfo::SetFunction().
|
private |
Definition at line 2677 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Post(), CFileHandleDiagHandler::Reopen(), CFileHandleDiagHandler::Valid(), CFileHandleDiagHandler::WriteMessage(), and CFileHandleDiagHandler::~CFileHandleDiagHandler().
|
private |
Definition at line 2678 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Post(), CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::~CFileHandleDiagHandler().
|
private |
Class handler.
Definition at line 2979 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 2675 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Post(), CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::Valid().
|
private |
Definition at line 131 of file request_ctx.hpp.
Referenced by CSharedHitId::Empty(), CSharedHitId::GetHitId(), and CSharedHitId::x_SetHitId().
|
private |
Definition at line 469 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::IsSetHitID(), CRequestContext::SetHitID(), CRequestContext::UnsetHitID(), CRequestContext::x_GetHitID(), CRequestContext::x_LogHitID(), CRequestContext::x_LogHitIDOnError(), CRequestContext::x_SetHitID(), and CRequestContext::x_UpdateSubHitID().
|
mutableprivate |
Definition at line 471 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::StopRequest(), CRequestContext::UnsetHitID(), CRequestContext::x_LogHitID(), CRequestContext::x_LogHitIDOnError(), and CRequestContext::x_SetHitID().
|
mutableprivate |
Definition at line 2355 of file ncbidiag.hpp.
Referenced by CDiagContext::GetEncodedHost(), CDiagContext::GetEncodedHostname(), CDiagContext::GetHost(), and CDiagContext::GetHostname().
|
private |
Definition at line 2356 of file ncbidiag.hpp.
Referenced by CDiagContext::GetEncodedHost(), CDiagContext::GetHost(), CDiagContext::GetHostIP(), and SInteractiveNewRequestStart::SExtra::Print().
|
private |
Definition at line 121 of file syslog.hpp.
Referenced by CSysLog::x_Connect().
|
private |
Ignore to die on die sev.
Definition at line 2975 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Map storing error codes and descriptions.
Definition at line 3086 of file ncbidiag.hpp.
Referenced by CDiagErrCodeInfo::GetDescription().
|
private |
Definition at line 178 of file perf_log.hpp.
Referenced by CPerfLogGuard::AddParameter(), CPerfLogger::CPerfLogger(), CPerfLogger::Discard(), CPerfLogGuard::Post(), CPerfLogger::x_CheckValidity(), CPerfLogger::~CPerfLogger(), and CPerfLogGuard::~CPerfLogGuard().
|
private |
Definition at line 487 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetReadOnly(), CRequestContext::SetReadOnly(), and CRequestContext::x_CanModify().
|
private |
Definition at line 478 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::IsRunning(), CRequestContext::StartRequest(), and CRequestContext::StopRequest().
|
private |
Definition at line 182 of file perf_log.hpp.
Referenced by CPerfLogger::GetElapsedTime(), CPerfLogger::Post(), CPerfLogger::Start(), and CPerfLogger::Suspend().
EDiagSev Severity::m_Level |
Severity level.
Definition at line 837 of file ncbidiag.hpp.
|
private |
Definition at line 111 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::SetLine().
size_t SDiagMessage::m_Line |
Line number in file.
Definition at line 1658 of file ncbidiag.hpp.
Referenced by ncbi::CNcbiToolkit_LogMessage::Line(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CwxLogDiagHandler::Post(), CWindowsCmdErrorHandler::Post(), SDiagMessage::SDiagMessage(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
Definition at line 2776 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::GetLogFile(), CFileDiagHandler::GetLogStream(), CFileDiagHandler::Reopen(), CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_GetHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
mutableprivate |
Definition at line 2362 of file ncbidiag.hpp.
Referenced by CDiagContext::SetDefaultHitID(), CDiagContext::x_GetDefaultHitID(), and CDiagContext::x_LogHitID().
|
private |
Definition at line 334 of file perf_log.hpp.
Referenced by CPerfLogGuard::AddParameter(), CPerfLogGuard::Discard(), CPerfLogGuard::GetLogger(), CPerfLogGuard::Post(), CPerfLogGuard::Start(), CPerfLogGuard::Suspend(), and CPerfLogGuard::~CPerfLogGuard().
|
private |
Definition at line 2585 of file ncbidiag.hpp.
Referenced by CStreamDiagHandler_Base::GetLogName(), and CStreamDiagHandler_Base::SetLogName().
|
private |
Definition at line 2676 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Reopen(), and CFileHandleDiagHandler::Valid().
|
private |
Definition at line 2370 of file ncbidiag.hpp.
Referenced by CDiagContext::InitMessages(), and CDiagContext::PushMessage().
string SDiagErrCodeDescription::m_Message |
Error message (short)
Definition at line 3013 of file ncbidiag.hpp.
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
Definition at line 2369 of file ncbidiag.hpp.
Referenced by CDiagContext::DiscardMessages(), CDiagContext::FlushMessages(), CDiagContext::InitMessages(), CDiagContext::IsCollectingMessages(), and CDiagContext::PushMessage().
|
private |
Definition at line 2683 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Post(), and CFileHandleDiagHandler::Reopen().
|
private |
Definition at line 110 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::CDiagCompileInfo(), and CDiagCompileInfo::SetModule().
|
private |
Definition at line 871 of file ncbidiag.hpp.
const char* SDiagMessage::m_Module |
Module name.
Definition at line 1655 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_GetModule(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
bool SDiagMessage::m_NoTee |
Special flag indicating that the message should not be printed by Tee-handler.
Definition at line 1685 of file ncbidiag.hpp.
Referenced by CTeeDiagHandler::Post().
|
mutableprivate |
Definition at line 1212 of file ncbidiag.hpp.
Referenced by CNcbiDiag::GetOmitStackTrace(), CNcbiDiag::SetOmitStackTrace(), and CNcbiDiag::x_Put().
Definition at line 609 of file request_ctx.hpp.
Referenced by CRequestContextGuard_Base::CRequestContextGuard_Base(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
|
private |
Definition at line 2775 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 486 of file request_ctx.hpp.
Referenced by CDiagContextThreadData::SetRequestContext().
|
private |
Definition at line 2777 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 2781 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 2779 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 336 of file perf_log.hpp.
Referenced by CPerfLogGuard::AddParameter(), and CPerfLogGuard::Post().
|
mutableprivate |
Definition at line 114 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::ParseCurrFunctName(), and CDiagCompileInfo::SetFunction().
|
mutableprivate |
Definition at line 496 of file request_ctx.hpp.
Referenced by CRequestContext::AddPassThroughProperty(), CRequestContext_PassThrough::Enumerate(), CRequestContext::Reset(), CRequestContext_PassThrough::x_DeserializeUrlEncoded(), CRequestContext::x_GetPassThroughProp(), CRequestContext::x_IsSetPassThroughProp(), CRequestContext::x_LoadEnvContextProperties(), CRequestContext::x_ResetPassThroughProp(), CRequestContext_PassThrough::x_SerializeUrlEncoded(), and CRequestContext::x_SetPassThroughProp().
|
private |
Definition at line 2780 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::GetLogFile(), CFileDiagHandler::GetLogStream(), CFileDiagHandler::Reopen(), CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_GetHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 1923 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), and CDiagContext_Extra::operator=().
|
private |
Definition at line 1924 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), and CDiagContext_Extra::operator=().
TPID SDiagMessage::m_PID |
Process ID.
Definition at line 1665 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().
|
mutableprivate |
Bitwise OR of "EDiagPostFlag".
Definition at line 1211 of file ncbidiag.hpp.
Referenced by CNcbiDiag::ResetIsConsoleFlag(), and CNcbiDiag::ResetIsNoteFlag().
|
private |
Post flags.
Definition at line 2972 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Message prefix.
Definition at line 2970 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Post severity.
Definition at line 2973 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Severity change.
Definition at line 2974 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
const char* SDiagMessage::m_Prefix |
Prefix string.
Definition at line 1662 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), SDiagMessage::x_InitData(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
List of prefixes.
Definition at line 2971 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 1381 of file ncbidiag.hpp.
Referenced by CDiagCollectGuard::GetPrintSeverity(), CDiagCollectGuard::SetPrintSeverity(), and CDiagCollectGuard::x_Init().
bool SDiagMessage::m_PrintStackTrace |
Definition at line 1687 of file ncbidiag.hpp.
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
TCount SDiagMessage::m_ProcPost |
Number of the post in the process.
Definition at line 1667 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().
|
private |
Definition at line 2367 of file ncbidiag.hpp.
Referenced by CDiagContext::DeleteProperty(), CDiagContext::GetProperty(), CDiagContext::PrintProperties(), and CDiagContext::SetProperty().
|
private |
Definition at line 476 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetProperties(), CRequestContext::GetProperty(), CRequestContext::IsSetProperty(), CRequestContext::SetProperty(), and CRequestContext::UnsetProperty().
|
private |
Definition at line 477 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::x_IsSetProp(), CRequestContext::x_SetProp(), and CRequestContext::x_UnsetProp().
|
private |
Quick flush of stream flag.
Definition at line 2618 of file ncbidiag.hpp.
Referenced by CStreamDiagHandler::Post().
|
private |
Definition at line 2679 of file ncbidiag.hpp.
Referenced by CFileHandleDiagHandler::Post(), CFileHandleDiagHandler::Reopen(), CFileHandleDiagHandler::WriteMessage(), and CFileHandleDiagHandler::~CFileHandleDiagHandler().
|
private |
Definition at line 2782 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::Post(), CFileDiagHandler::Reopen(), CFileDiagHandler::SetLogFile(), CFileDiagHandler::WriteMessage(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Definition at line 472 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetRequestStatus(), CRequestContext::SetRequestStatus(), and CRequestContext::UnsetRequestStatus().
|
private |
Definition at line 473 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetRequestTimer(), and CRequestContext::Reset().
|
mutableprivate |
Definition at line 608 of file request_ctx.hpp.
Referenced by CRequestContextGuard_Base::CRequestContextGuard_Base(), CRequestContextGuard_Base::GetRequestContext(), CRequestContextGuard_Base::Release(), CRequestContextGuard_Base::SetDefaultErrorStatus(), CRequestContextGuard_Base::SetStatus(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
TCount SDiagMessage::m_RequestId |
FastCGI iteration or request ID.
Definition at line 1669 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().
|
private |
Definition at line 465 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetRequestID(), CRequestContext::SetRequestID(), and CRequestContext::UnsetRequestID().
|
private |
Definition at line 335 of file perf_log.hpp.
Referenced by CPerfLogGuard::Post().
|
private |
Definition at line 607 of file request_ctx.hpp.
Referenced by CRequestContextGuard_Base::CRequestContextGuard_Base(), CRequestContextGuard_Base::Release(), and CRequestContextGuard_Base::~CRequestContextGuard_Base().
|
private |
Definition at line 468 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetEncodedSessionID(), CRequestContext::GetSessionID(), CRequestContext::SetSessionID(), and CRequestContext::UnsetSessionID().
|
mutableprivate |
Severity level of current msg.
Definition at line 1207 of file ncbidiag.hpp.
|
mutable |
Severity level.
Definition at line 1651 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), DisplayDiagnostic(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), CBlastAppDiagHandler::Post(), CAsyncDiagHandler::Post(), CSysLog::Post(), CTeeDiagHandler::Post(), CTable2AsnLogger::Post(), CPythonDiagHandler::Post(), CwxLogDiagHandler::Post(), CWindowsCmdErrorHandler::Post(), CDiagHandler::PostToConsole(), SDiagMessage::SDiagMessage(), ncbi::CNcbiToolkit_LogMessage::Severity(), CFileDiagHandler::x_GetDiagFileType(), SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
int SDiagErrCodeDescription::m_Severity |
Message severity (if less that 0, then use current diagnostic severity level)
Definition at line 3015 of file ncbidiag.hpp.
Referenced by SDiagMessage::x_NewWrite(), and SDiagMessage::x_OldWrite().
|
private |
Definition at line 1383 of file ncbidiag.hpp.
Referenced by CDiagCollectGuard::GetSeverityCap(), CDiagCollectGuard::SetSeverityCap(), and CDiagCollectGuard::x_Init().
|
mutableprivate |
Definition at line 133 of file request_ctx.hpp.
Referenced by CSharedHitId::GetCurrentSubHitId(), CSharedHitId::GetNextSubHitId(), CSharedHitId::IsShared(), CSharedHitId::SetHitId(), and CSharedHitId::SetShared().
|
private |
Definition at line 2422 of file ncbidiag.hpp.
Referenced by CNcbiLogFields::x_Match().
|
private |
Definition at line 60 of file jaeger_tracer.hpp.
Referenced by CJaegerTracerSpan::GetSpan().
|
private |
Definition at line 1380 of file ncbidiag.hpp.
Referenced by CDiagCollectGuard::GetStartingPoint(), and CDiagCollectGuard::x_Init().
|
private |
Definition at line 2368 of file ncbidiag.hpp.
Referenced by CDiagContext::x_PrintMessage().
|
private |
Definition at line 176 of file perf_log.hpp.
Referenced by CPerfLogger::CPerfLogger(), CPerfLogger::GetElapsedTime(), CPerfLogger::Post(), CPerfLogger::Start(), and CPerfLogger::Suspend().
|
private |
Definition at line 122 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::CDiagCompileInfo(), CDiagCompileInfo::SetFunction(), and CDiagCompileInfo::~CDiagCompileInfo().
|
protected |
Diagnostic stream.
Definition at line 2615 of file ncbidiag.hpp.
Referenced by CStreamDiagHandler::GetStream(), CStreamDiagHandler::Post(), and CEmailDiagHandler::~CEmailDiagHandler().
|
private |
Definition at line 120 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::CDiagCompileInfo(), CDiagCompileInfo::SetFile(), and CDiagCompileInfo::~CDiagCompileInfo().
|
private |
Definition at line 121 of file ncbidiag.hpp.
Referenced by CDiagCompileInfo::SetModule().
int ErrCode::m_SubCode |
|
private |
Definition at line 132 of file request_ctx.hpp.
Referenced by CSharedHitId::GetCurrentSubHitId(), CSharedHitId::GetNextSubHitId(), CSharedHitId::SetHitId(), and CSharedHitId::SetShared().
|
private |
Definition at line 481 of file request_ctx.hpp.
Referenced by CRequestContext::Clone(), CRequestContext::GetCurrentSubHitID(), CRequestContext::GetNextSubHitID(), CRequestContext::UnsetHitID(), CRequestContext::x_SetHitID(), and CRequestContext::x_UpdateSubHitID().
|
private |
Definition at line 2832 of file ncbidiag.hpp.
Referenced by CAsyncDiagHandler::InstallToDiag(), and CAsyncDiagHandler::SetCustomThreadSuffix().
TCount SDiagMessage::m_ThrPost |
Number of the post in the thread.
Definition at line 1668 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().
TTID SDiagMessage::m_TID |
Thread ID.
Definition at line 1666 of file ncbidiag.hpp.
Referenced by SDiagMessage::operator=(), SDiagMessage::ParseMessage(), SDiagMessage::SDiagMessage(), and CDiagContext::WriteStdPrefix().
|
private |
Definition at line 177 of file perf_log.hpp.
Referenced by CPerfLogger::CPerfLogger(), CPerfLogger::Discard(), CPerfLogger::GetElapsedTime(), CPerfLogger::Start(), CPerfLogger::Suspend(), and CPerfLogger::~CPerfLogger().
|
private |
Definition at line 2778 of file ncbidiag.hpp.
Referenced by CFileDiagHandler::GetLogFile(), CFileDiagHandler::GetLogStream(), CFileDiagHandler::Reopen(), CFileDiagHandler::SetLogFile(), CFileDiagHandler::SetOwnership(), CFileDiagHandler::SetSubHandler(), CFileDiagHandler::x_GetHandler(), CFileDiagHandler::x_ResetHandler(), CFileDiagHandler::x_SetHandler(), and CFileDiagHandler::~CFileDiagHandler().
|
private |
Default trace setting.
Definition at line 2977 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Trace enabled?
Definition at line 2978 of file ncbidiag.hpp.
Referenced by CDiagRestorer::CDiagRestorer(), and CDiagRestorer::~CDiagRestorer().
|
private |
Definition at line 2379 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), CDiagContext::ResetLogRates(), CDiagContext::SetLogRate_Limit(), and CDiagContext::SetLogRate_Period().
|
private |
Definition at line 2382 of file ncbidiag.hpp.
Referenced by CDiagContext::ApproveMessage(), CDiagContext::ResetLogRates(), CDiagContext::SetLogRate_Limit(), and CDiagContext::SetLogRate_Period().
|
private |
Definition at line 498 of file request_ctx.hpp.
Referenced by CRequestContext::SetRequestTracer(), CRequestContext::StartRequest(), and CRequestContext::StopRequest().
|
private |
Definition at line 499 of file request_ctx.hpp.
Referenced by CRequestContext::GetTracerSpan(), and CRequestContext::SetTracerSpan().
|
private |
Definition at line 1921 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), CDiagContext_Extra::operator=(), and CDiagContext_Extra::SetType().
bool SDiagMessage::m_TypedExtra |
Set to true if this is a typed extra message (the arguments include "NCBIEXTRATYPE=<extra-type>").
Definition at line 1681 of file ncbidiag.hpp.
Referenced by CDiagContext_Extra::Flush(), SDiagMessage::operator=(), SDiagMessage::ParseMessage(), and SDiagMessage::x_ParseExtraArgs().
|
mutableprivate |
Definition at line 2354 of file ncbidiag.hpp.
Referenced by CDiagContext::GetUID(), CDiagContext::x_CreateUID(), and CDiagContext::x_CreateUID_AsyncSafe().
|
private |
Definition at line 2357 of file ncbidiag.hpp.
Referenced by CDiagContext::GetUsername(), and CDiagContext::SetUsername().
|
private |
Definition at line 488 of file request_ctx.hpp.
Referenced by CRequestContext::GetVersion(), and CRequestContext::x_Modify().
Definition at line 2374 of file ncbidiag.hpp.
Referenced by CDiagContext::IsApplogSeverityLocked(), and CDiagContext::SetApplogSeverityLocked().
|
staticprivate |
Definition at line 502 of file request_ctx.hpp.
Referenced by CRequestContext::sx_GetContextFieldsMask().
Definition at line 120 of file syslog.hpp.
Referenced by CSysLog::HonorRegistrySettings(), CSysLog::Post(), CSysLog::x_Connect(), and CSysLog::~CSysLog().
|
staticprivate |
Definition at line 505 of file request_ctx.hpp.
Referenced by CRequestContext::x_LoadEnvContextProperties().
|
staticprivate |
Definition at line 2371 of file ncbidiag.hpp.
Referenced by CDiagContext::CDiagContext(), CDiagContext::SetProperty(), and CDiagContext::~CDiagContext().
|
staticprivate |
Definition at line 2352 of file ncbidiag.hpp.
Referenced by CDiagContext::GetPID(), and CDiagContext::UpdatePID_AsyncSafe().
|
staticprivate |
Definition at line 507 of file request_ctx.hpp.
Referenced by CRequestContext::x_Modify().
const char* SNcbiLog_Param::value |
Definition at line 277 of file ncbi_c_log.h.
Referenced by NcbiLog_AppRun(), s_AddParamsPair(), s_LogHitID(), s_LogSubHitID(), s_PrintParams(), and s_PrintReqStartExtraParams().
|
friend |
Definition at line 2331 of file ncbidiag.hpp.
|
friend |
Definition at line 452 of file request_ctx.hpp.
|
friend |
Definition at line 1745 of file ncbidiag.hpp.
|
friend |
Definition at line 1912 of file ncbidiag.hpp.
|
friend |
Definition at line 395 of file request_ctx.hpp.
|
friend |
Definition at line 1757 of file ncbidiag.hpp.
|
friend |
Definition at line 2320 of file ncbidiag.hpp.
Referenced by CDiagContext::Extra(), and CDiagContext::PrintRequestStart().
|
friend |
Definition at line 2330 of file ncbidiag.hpp.
|
friend |
Definition at line 484 of file request_ctx.hpp.
|
friend |
Definition at line 91 of file ncbidiag.hpp.
Set IsConsole flag to indicate that the current post should go to console regardless of its severity (in addition to the default output – file etc.).
Do not flush current post or change the severity. The flag is reset by the next Flush().
|
friend |
Definition at line 173 of file perf_log.hpp.
|
friend |
Definition at line 2332 of file ncbidiag.hpp.
|
friend |
Definition at line 495 of file request_ctx.hpp.
Flush current message, then set a severity for the next diagnostic message to CRITICAL ERROR.
Flush current message, start new one.
Referenced by CNcbiDiag::DiagAssert(), CNcbiDiag::DiagFatal(), and CNcbiDiag::DiagTrouble().
Flush current message, then set a severity for the next diagnostic message to ERROR.
Flush current message, then set a severity for the next diagnostic message to FATAL.
|
friend |
Definition at line 8347 of file ncbidiag.cpp.
Flush current message, then set a severity for the next diagnostic message to INFO.
Set IsMessage flag to indicate that the current post is a message.
Do not flush current post or change the severity. The flag is reset by the next Flush().
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().
Flush current message, then set a severity for the next diagnostic message to TRACE.