Go to the source code of this file.
Macros | |
#define | LOGDOMAIN_MAXLEN 30 |
#define | LOGDOMAIN_DEFAULT "srd: " |
Functions | |
SRD_API int | srd_log_loglevel_set (int loglevel) |
Set the libsigrokdecode loglevel. More... | |
SRD_API int | srd_log_loglevel_get (void) |
Get the libsigrokdecode loglevel. More... | |
SRD_API int | srd_log_logdomain_set (const char *logdomain) |
Set the libsigrokdecode logdomain string. More... | |
SRD_API char * | srd_log_logdomain_get (void) |
Get the currently configured libsigrokdecode logdomain. More... | |
SRD_API int | srd_log_callback_set (srd_log_callback_t cb, void *cb_data) |
Set the libsigrokdecode log callback to the specified function. More... | |
SRD_API int | srd_log_callback_set_default (void) |
Set the libsigrokdecode log callback to the default built-in one. More... | |
SRD_PRIV int | srd_log (int loglevel, const char *format,...) |
SRD_PRIV int | srd_spew (const char *format,...) |
SRD_PRIV int | srd_dbg (const char *format,...) |
SRD_PRIV int | srd_info (const char *format,...) |
SRD_PRIV int | srd_warn (const char *format,...) |
SRD_PRIV int | srd_err (const char *format,...) |
#define LOGDOMAIN_MAXLEN 30 |
Definition at line 43 of file log.c.
Referenced by srd_log_logdomain_set().
SRD_PRIV int srd_dbg | ( | const char * | format, |
... | |||
) |
Definition at line 221 of file log.c.
References SRD_LOG_DBG.
Referenced by py_attr_as_str(), py_dictitem_as_str(), py_str_as_str(), srd_decoder_load(), srd_decoder_searchpath_add(), srd_decoder_unload(), srd_exception_catch(), srd_exit(), srd_init(), srd_inst_decode(), srd_inst_free(), srd_inst_new(), srd_inst_pd_output_add(), srd_inst_probe_set_all(), srd_inst_start(), srd_log_logdomain_set(), srd_log_loglevel_set(), srd_pd_output_callback_add(), srd_session_send(), and srd_session_start().
SRD_PRIV int srd_err | ( | const char * | format, |
... | |||
) |
Definition at line 260 of file log.c.
References SRD_LOG_ERR.
Referenced by py_strlist_to_char(), srd_decoder_load(), srd_decoder_load_all(), srd_exception_catch(), srd_inst_new(), srd_inst_option_set(), srd_inst_pd_output_add(), srd_inst_probe_set_all(), srd_inst_stack(), srd_inst_start(), srd_log_callback_set(), srd_log_logdomain_set(), srd_log_loglevel_set(), srd_pd_output_callback_add(), and srd_session_start().
SRD_PRIV int srd_info | ( | const char * | format, |
... | |||
) |
Definition at line 234 of file log.c.
References SRD_LOG_INFO.
SRD_PRIV int srd_log | ( | int | loglevel, |
const char * | format, | ||
... | |||
) |
SRD_API int srd_log_callback_set | ( | srd_log_callback_t | cb, |
void * | cb_data | ||
) |
Set the libsigrokdecode log callback to the specified function.
cb | Function pointer to the log callback function to use. Must not be NULL. |
cb_data | Pointer to private data to be passed on. This can be used by the caller to pass arbitrary data to the log functions. This pointer is only stored or passed on by libsigrokdecode, and is never used or interpreted in any way. The pointer is allowed to be NULL if the caller doesn't need/want to pass any data. |
Definition at line 142 of file log.c.
References srd_err(), SRD_ERR_ARG, and SRD_OK.
SRD_API int srd_log_callback_set_default | ( | void | ) |
SRD_API char* srd_log_logdomain_get | ( | void | ) |
SRD_API int srd_log_logdomain_set | ( | const char * | logdomain | ) |
Set the libsigrokdecode logdomain string.
logdomain | The string to use as logdomain for libsigrokdecode log messages from now on. Must not be NULL. The maximum length of the string is 30 characters (this does not include the trailing NUL-byte). Longer strings are silently truncated. In order to not use a logdomain, pass an empty string. The function makes its own copy of the input string, i.e. the caller does not need to keep it around. |
Definition at line 101 of file log.c.
References LOGDOMAIN_MAXLEN, srd_dbg(), srd_err(), SRD_ERR_ARG, and SRD_OK.
SRD_API int srd_log_loglevel_get | ( | void | ) |
SRD_API int srd_log_loglevel_set | ( | int | loglevel | ) |
Set the libsigrokdecode loglevel.
This influences the amount of log messages (debug messages, error messages, and so on) libsigrokdecode will output. Using SRD_LOG_NONE disables all messages.
Note that this function itself will also output log messages. After the loglevel has changed, it will output a debug message with SRD_LOG_DBG for example. Whether this message is shown depends on the (new) loglevel.
loglevel | The loglevel to set (SRD_LOG_NONE, SRD_LOG_ERR, SRD_LOG_WARN, SRD_LOG_INFO, SRD_LOG_DBG, or SRD_LOG_SPEW). |
Definition at line 63 of file log.c.
References srd_dbg(), srd_err(), SRD_ERR_ARG, SRD_LOG_SPEW, and SRD_OK.
SRD_PRIV int srd_spew | ( | const char * | format, |
... | |||
) |
Definition at line 208 of file log.c.
References SRD_LOG_SPEW.
SRD_PRIV int srd_warn | ( | const char * | format, |
... | |||
) |
Definition at line 247 of file log.c.
References SRD_LOG_WARN.