|
int | KSI_LOG_debug (KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf |
|
int int | KSI_LOG_info (KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf |
|
int int int | KSI_LOG_notice (KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf |
|
int int int int | KSI_LOG_warn (KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf |
|
int int int int int | KSI_LOG_error (KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf |
|
int int int int int int | KSI_LOG_logBlob (KSI_CTX *ctx, int level, const char *prefix_format, const unsigned char *data, size_t data_len,...) KSI_ATTRIBUTE((format(printf |
|
int int int int int int int | KSI_LOG_logTlv (KSI_CTX *ctx, int level, const char *prefix, const KSI_TLV *tlv) |
|
int | KSI_LOG_logDataHash (KSI_CTX *ctx, int level, const char *prefix, const KSI_DataHash *hsh) |
|
int | KSI_LOG_logCtxError (KSI_CTX *ctx, int level) |
|
int | KSI_LOG_StreamLogger (void *logCtx, int logLevel, const char *message) |
|
This group contains primitive functions for logging. There are 6 predefined log levels and one level for disabling logging.
Log level.
Enumerator |
---|
KSI_LOG_NONE |
Logging is turned off.
|
KSI_LOG_ERROR |
Error log level - unrecoverable fatal errors only - gasp of death - code cannot continue and will terminate.
|
KSI_LOG_WARN |
Warning log level - changes in state that affects the service degradation.
|
KSI_LOG_NOTICE |
Notice log level - changes in state that do not necessarily cause service degradation.
|
KSI_LOG_INFO |
Info log level - events that have no effect on service, but can aid in performance, status and statistics monitoring.
|
KSI_LOG_DEBUG |
Debug log level - events generated to aid in debugging, application flow and detailed service troubleshooting.
|
int KSI_LOG_debug |
( |
KSI_CTX * |
ctx, |
|
|
char * |
format, |
|
|
|
... |
|
) |
| |
Logging for debug level. Events generated to aid in debugging, application flow and detailed service troubleshooting.
- Parameters
-
[in] | ctx | KSI context. |
[in] | format | Format string. |
[in] | ... | Arguments. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
int int int int int KSI_LOG_error |
( |
KSI_CTX * |
ctx, |
|
|
char * |
format, |
|
|
|
... |
|
) |
| |
Logging for error level. Unrecoverable fatal errors only - gasp of death - code cannot continue and will terinate.
- Parameters
-
[in] | ctx | KSI context. |
[in] | format | Format string. |
[in] | ... | Arguments. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
int int KSI_LOG_info |
( |
KSI_CTX * |
ctx, |
|
|
char * |
format, |
|
|
|
... |
|
) |
| |
Logging for info level. Events that have no effect on service, but can aid in performance, status and statistics monitoring.
- Parameters
-
[in] | ctx | KSI context. |
[in] | format | Format string. |
[in] | ... | Arguments. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
int int int int int int KSI_LOG_logBlob |
( |
KSI_CTX * |
ctx, |
|
|
int |
level, |
|
|
const char * |
prefix_format, |
|
|
const unsigned char * |
data, |
|
|
size_t |
data_len, |
|
|
|
... |
|
) |
| |
A helper function for logging raw data. The log message will be prefixed with prefix_format
and the binary data is logged as hex.
- Parameters
-
[in] | ctx | KSI context. |
[in] | level | Log level. |
[in] | prefix_format | Format string for the log prefix message. |
[in] | data | Pointer to the raw data. |
[in] | data_len | Length of the data. |
[in] | ... | Arguments. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
int KSI_LOG_logCtxError |
( |
KSI_CTX * |
ctx, |
|
|
int |
level |
|
) |
| |
A helper function for logging KSI context error trace.
- Parameters
-
[in] | ctx | KSI context. |
[in] | level | Log level. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- See also
- KSI_ERR_statusDump
int KSI_LOG_logDataHash |
( |
KSI_CTX * |
ctx, |
|
|
int |
level, |
|
|
const char * |
prefix, |
|
|
const KSI_DataHash * |
hsh |
|
) |
| |
A helper function for logging plain KSI_TLV objects. The log message will be prefixed with prefix
and the TLV is logged as text on multiple lines (KSI_TLV_toString)
- Parameters
-
[in] | ctx | KSI context. |
[in] | level | Log level. |
[in] | prefix | Prefix for the log message. |
[in] | hsh | Hash value to be logged. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- See also
- KSI_TLV_toString
int int int int int int int KSI_LOG_logTlv |
( |
KSI_CTX * |
ctx, |
|
|
int |
level, |
|
|
const char * |
prefix, |
|
|
const KSI_TLV * |
tlv |
|
) |
| |
A helper function for logging plain KSI_TLV objects. The log message will be prefixed with prefix
and the TLV is logged as text on multiple lines (KSI_TLV_toString)
- Parameters
-
[in] | ctx | KSI context. |
[in] | level | Log level. |
[in] | prefix | Prefix for the log message. |
[in] | tlv | TLV to be logged. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- See also
- KSI_TLV_toString
int int int KSI_LOG_notice |
( |
KSI_CTX * |
ctx, |
|
|
char * |
format, |
|
|
|
... |
|
) |
| |
Logging for info level. Changes in state that do not necessarily cause service degradation.
- Parameters
-
[in] | ctx | KSI context. |
[in] | format | Format string. |
[in] | ... | Arguments. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
int KSI_LOG_StreamLogger |
( |
void * |
logCtx, |
|
|
int |
logLevel, |
|
|
const char * |
message |
|
) |
| |
The stream logger is a simple logging call-back to be used with KSI_CTX_setLoggerCallback. It will output the value to a FILE
stream.
- Parameters
-
[in] | logCtx | A stream to write the log messages. |
[in] | logLevel | Log level. |
[in] | message | Formatted log message. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- See also
- KSI_CTX_setLoggerCallback, KSI_LoggerCallback
int int int int KSI_LOG_warn |
( |
KSI_CTX * |
ctx, |
|
|
char * |
format, |
|
|
|
... |
|
) |
| |
Logging for warning level. Changes in state that affects the service degradation.
- Parameters
-
[in] | ctx | KSI context. |
[in] | format | Format string. |
[in] | ... | Arguments. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).