OpenOCD
|
Logging functions. More...
Go to the source code of this file.
Functions | |
JAYLINK_API const char * | jaylink_log_get_domain (const struct jaylink_context *ctx) |
Get the libjaylink log domain. More... | |
JAYLINK_API int | jaylink_log_get_level (const struct jaylink_context *ctx, enum jaylink_log_level *level) |
Get the libjaylink log level. More... | |
JAYLINK_API int | jaylink_log_set_callback (struct jaylink_context *ctx, jaylink_log_callback callback, void *user_data) |
Set the libjaylink log callback function. More... | |
JAYLINK_API int | jaylink_log_set_domain (struct jaylink_context *ctx, const char *domain) |
Set the libjaylink log domain. More... | |
JAYLINK_API int | jaylink_log_set_level (struct jaylink_context *ctx, enum jaylink_log_level level) |
Set the libjaylink log level. More... | |
Logging functions.
Definition in file jtag/drivers/libjaylink/libjaylink/log.c.
JAYLINK_API const char* jaylink_log_get_domain | ( | const struct jaylink_context * | ctx | ) |
Get the libjaylink log domain.
[in] | ctx | libjaylink context. |
Definition at line 161 of file jtag/drivers/libjaylink/libjaylink/log.c.
References jaylink_context::log_domain, and NULL.
JAYLINK_API int jaylink_log_get_level | ( | const struct jaylink_context * | ctx, |
enum jaylink_log_level * | level | ||
) |
Get the libjaylink log level.
[in] | ctx | libjaylink context. |
[out] | level | Log level on success, and undefined on failure. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
Definition at line 72 of file jtag/drivers/libjaylink/libjaylink/log.c.
References JAYLINK_ERR_ARG, JAYLINK_OK, and jaylink_context::log_level.
JAYLINK_API int jaylink_log_set_callback | ( | struct jaylink_context * | ctx, |
jaylink_log_callback | callback, | ||
void * | user_data | ||
) |
Set the libjaylink log callback function.
[in,out] | ctx | libjaylink context. |
[in] | callback | Callback function to use, or NULL to use the default log function. |
[in] | user_data | User data to be passed to the callback function. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
Definition at line 96 of file jtag/drivers/libjaylink/libjaylink/log.c.
References JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_context::log_callback, jaylink_context::log_callback_data, log_vprintf(), and NULL.
Referenced by jlink_init().
JAYLINK_API int jaylink_log_set_domain | ( | struct jaylink_context * | ctx, |
const char * | domain | ||
) |
Set the libjaylink log domain.
The log domain is a string which is used as prefix for all log messages to differentiate them from messages of other libraries.
The maximum length of the log domain is JAYLINK_LOG_DOMAIN_MAX_LENGTH bytes, excluding the trailing null-terminator. A log domain which exceeds this length will be silently truncated.
[in,out] | ctx | libjaylink context. |
[in] | domain | Log domain to use. To set the default log domain, use JAYLINK_LOG_DOMAIN_DEFAULT. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR | Other error conditions. |
Definition at line 133 of file jtag/drivers/libjaylink/libjaylink/log.c.
References JAYLINK_ERR, JAYLINK_ERR_ARG, JAYLINK_LOG_DOMAIN_MAX_LENGTH, JAYLINK_OK, and jaylink_context::log_domain.
Referenced by jaylink_init().
JAYLINK_API int jaylink_log_set_level | ( | struct jaylink_context * | ctx, |
enum jaylink_log_level | level | ||
) |
Set the libjaylink log level.
[in,out] | ctx | libjaylink context. |
[in] | level | Log level to set. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
Definition at line 47 of file jtag/drivers/libjaylink/libjaylink/log.c.
References JAYLINK_ERR_ARG, JAYLINK_LOG_LEVEL_DEBUG_IO, JAYLINK_OK, and jaylink_context::log_level.