libsigrok
|
Go to the source code of this file.
Defines | |
#define | LOGDOMAIN_MAXLEN 30 |
#define | LOGDOMAIN_DEFAULT "sr: " |
Functions | |
SR_API int | sr_log_loglevel_set (int loglevel) |
Set the libsigrok loglevel. | |
SR_API int | sr_log_loglevel_get (void) |
Get the libsigrok loglevel. | |
SR_API int | sr_log_logdomain_set (const char *logdomain) |
Set the libsigrok logdomain string. | |
SR_API char * | sr_log_logdomain_get (void) |
Get the currently configured libsigrok logdomain. | |
SR_API int | sr_log_callback_set (sr_log_callback_t cb, void *cb_data) |
Set the libsigrok log callback to the specified function. | |
SR_API int | sr_log_callback_set_default (void) |
Set the libsigrok log callback to the default built-in one. | |
SR_PRIV int | sr_log (int loglevel, const char *format,...) |
SR_PRIV int | sr_spew (const char *format,...) |
SR_PRIV int | sr_dbg (const char *format,...) |
SR_PRIV int | sr_info (const char *format,...) |
SR_PRIV int | sr_warn (const char *format,...) |
SR_PRIV int | sr_err (const char *format,...) |
#define LOGDOMAIN_DEFAULT "sr: " |
#define LOGDOMAIN_MAXLEN 30 |
Definition at line 43 of file log.c.
Referenced by sr_log_logdomain_set().
Definition at line 217 of file log.c.
References SR_LOG_DBG.
Referenced by sr_dev_has_hwcap(), sr_dev_trigger_set(), sr_driver_init(), sr_log_logdomain_set(), sr_log_loglevel_set(), sr_session_dev_add(), and sr_session_load().
Definition at line 253 of file log.c.
References SR_LOG_ERR.
Referenced by command_get_fw_version(), command_get_revid_version(), command_start_acquisition(), data_ascii(), data_bits(), data_hex(), event(), ezusb_install_firmware(), ezusb_reset(), ezusb_upload_firmware(), gl_read_bulk(), init(), serial_backup_params(), sr_datastore_destroy(), sr_datastore_new(), sr_datastore_put(), sr_dev_has_hwcap(), sr_dev_inst_new(), sr_dev_new(), sr_dev_probe_add(), sr_dev_probe_find(), sr_dev_probe_name_set(), sr_dev_scan(), sr_dev_trigger_remove_all(), sr_dev_trigger_set(), sr_driver_hwcap_exists(), sr_filter_probes(), sr_log_callback_set(), sr_log_logdomain_set(), sr_log_loglevel_set(), sr_parse_triggerstring(), sr_period_string(), sr_samplerate_string(), sr_serial_dev_inst_new(), sr_session_datafeed_callback_add(), sr_session_datafeed_callback_remove_all(), sr_session_destroy(), sr_session_dev_add(), sr_session_dev_remove_all(), sr_session_halt(), sr_session_load(), sr_session_new(), sr_session_run(), sr_session_save(), sr_session_send(), sr_session_source_add(), sr_session_source_remove(), sr_session_start(), sr_session_stop(), and sr_usb_dev_inst_new().
Definition at line 229 of file log.c.
References SR_LOG_INFO.
Referenced by command_start_acquisition(), data_ascii(), data_bits(), ezusb_install_firmware(), ezusb_reset(), ezusb_upload_firmware(), sr_session_halt(), sr_session_run(), sr_session_save(), sr_session_start(), and sr_session_stop().
SR_API int sr_log_callback_set | ( | sr_log_callback_t | cb, |
void * | cb_data | ||
) |
Set the libsigrok 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 libsigrok, 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 140 of file log.c.
References sr_err(), SR_ERR_ARG, and SR_OK.
SR_API int sr_log_callback_set_default | ( | void | ) |
SR_API char* sr_log_logdomain_get | ( | void | ) |
SR_API int sr_log_logdomain_set | ( | const char * | logdomain | ) |
Set the libsigrok logdomain string.
logdomain | The string to use as logdomain for libsigrok 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 100 of file log.c.
References LOGDOMAIN_MAXLEN, sr_dbg(), sr_err(), SR_ERR_ARG, and SR_OK.
SR_API int sr_log_loglevel_get | ( | void | ) |
Get the libsigrok loglevel.
Definition at line 81 of file log.c.
Referenced by sr_session_send().
SR_API int sr_log_loglevel_set | ( | int | loglevel | ) |
Set the libsigrok loglevel.
This influences the amount of log messages (debug messages, error messages, and so on) libsigrok will output. Using SR_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 SR_LOG_DBG for example. Whether this message is shown depends on the (new) loglevel.
loglevel | The loglevel to set (SR_LOG_NONE, SR_LOG_ERR, SR_LOG_WARN, SR_LOG_INFO, SR_LOG_DBG, or SR_LOG_SPEW). |
Definition at line 62 of file log.c.
References sr_dbg(), sr_err(), SR_ERR_ARG, SR_LOG_SPEW, and SR_OK.
Definition at line 241 of file log.c.
References SR_LOG_WARN.
Referenced by sr_dev_inst_get(), and sr_driver_init().