X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=log.c;h=36dcd95958e83d98010b7197fee39e12247f3978;hp=d6df1564126a17c049b3bed2672998a632b8a05e;hb=c1f86f02a149f46609273e1bd5b42696d544727a;hpb=57790bc8c558ccf2e57b3d973c043088232628c7 diff --git a/log.c b/log.c index d6df156..36dcd95 100644 --- a/log.c +++ b/log.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrokdecode project. * * Copyright (C) 2011-2012 Uwe Hermann * @@ -18,11 +18,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "sigrokdecode.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */ -#include "sigrokdecode-internal.h" +#include "libsigrokdecode.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */ +#include "libsigrokdecode-internal.h" #include #include +/** + * @file + * + * Controlling the libsigrokdecode message logging functionality. + */ + +/** + * @defgroup grp_logging Logging + * + * Controlling the libsigrokdecode message logging functionality. + * + * @{ + */ + /* Currently selected libsigrokdecode loglevel. Default: SRD_LOG_WARN. */ static int srd_loglevel = SRD_LOG_WARN; /* Show errors+warnings per default. */ @@ -61,6 +75,8 @@ static char srd_log_domain[LOGDOMAIN_MAXLEN + 1] = LOGDOMAIN_DEFAULT; * SRD_LOG_WARN, SRD_LOG_INFO, SRD_LOG_DBG, or SRD_LOG_SPEW). * * @return SRD_OK upon success, SRD_ERR_ARG upon invalid loglevel. + * + * @since 0.1.0 */ SRD_API int srd_log_loglevel_set(int loglevel) { @@ -80,6 +96,8 @@ SRD_API int srd_log_loglevel_set(int loglevel) * Get the libsigrokdecode loglevel. * * @return The currently configured libsigrokdecode loglevel. + * + * @since 0.1.0 */ SRD_API int srd_log_loglevel_get(void) { @@ -99,6 +117,8 @@ SRD_API int srd_log_loglevel_get(void) * the caller does not need to keep it around. * * @return SRD_OK upon success, SRD_ERR_ARG upon invalid logdomain. + * + * @since 0.1.0 */ SRD_API int srd_log_logdomain_set(const char *logdomain) { @@ -121,6 +141,8 @@ SRD_API int srd_log_logdomain_set(const char *logdomain) * @return A copy of the currently configured libsigrokdecode logdomain * string. The caller is responsible for g_free()ing the string when * it is no longer needed. + * + * @since 0.1.0 */ SRD_API char *srd_log_logdomain_get(void) { @@ -140,6 +162,8 @@ SRD_API char *srd_log_logdomain_get(void) * pass any data. * * @return SRD_OK upon success, SRD_ERR_ARG upon invalid arguments. + * + * @since 0.1.0 */ SRD_API int srd_log_callback_set(srd_log_callback_t cb, void *cb_data) { @@ -162,6 +186,8 @@ SRD_API int srd_log_callback_set(srd_log_callback_t cb, void *cb_data) * Additionally, the internal 'srd_log_callback_data' pointer is set to NULL. * * @return SRD_OK upon success, a (negative) error code otherwise. + * + * @since 0.1.0 */ SRD_API int srd_log_callback_set_default(void) { @@ -277,3 +303,5 @@ SRD_PRIV int srd_err(const char *format, ...) return ret; } + +/** @} */