aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <jaylink-dev@marcschink.de>2017-06-03 09:46:12 +0200
committerMarc Schink <jaylink-dev@marcschink.de>2017-07-26 23:01:29 +0200
commit69ab6891a1bb2f4079827e9b1d2c94126366578b (patch)
tree1d06858dd61ca92637eec5859c13eaf06bdd4464
parent49845af97b0affa412f505d6baf31564dc76a327 (diff)
Add JAYLINK_LOG_LEVEL_DEBUG_IO
Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
-rw-r--r--libjaylink/libjaylink-internal.h2
-rw-r--r--libjaylink/libjaylink.h4
-rw-r--r--libjaylink/log.c17
3 files changed, 21 insertions, 2 deletions
diff --git a/libjaylink/libjaylink-internal.h b/libjaylink/libjaylink-internal.h
index c5b128b..f97ec14 100644
--- a/libjaylink/libjaylink-internal.h
+++ b/libjaylink/libjaylink-internal.h
@@ -250,6 +250,8 @@ JAYLINK_PRIV void log_info(const struct jaylink_context *ctx,
const char *format, ...);
JAYLINK_PRIV void log_dbg(const struct jaylink_context *ctx,
const char *format, ...);
+JAYLINK_PRIV void log_dbgio(const struct jaylink_context *ctx,
+ const char *format, ...);
/*--- socket.c --------------------------------------------------------------*/
diff --git a/libjaylink/libjaylink.h b/libjaylink/libjaylink.h
index ef00f76..223aa84 100644
--- a/libjaylink/libjaylink.h
+++ b/libjaylink/libjaylink.h
@@ -77,7 +77,9 @@ enum jaylink_log_level {
/** Output informational messages. */
JAYLINK_LOG_LEVEL_INFO = 3,
/** Output debug messages. */
- JAYLINK_LOG_LEVEL_DEBUG = 4
+ JAYLINK_LOG_LEVEL_DEBUG = 4,
+ /** Output I/O debug messages. */
+ JAYLINK_LOG_LEVEL_DEBUG_IO = 5
};
/** Default libjaylink log domain. */
diff --git a/libjaylink/log.c b/libjaylink/log.c
index af9bfd3..07ef172 100644
--- a/libjaylink/log.c
+++ b/libjaylink/log.c
@@ -50,7 +50,7 @@ JAYLINK_API int jaylink_log_set_level(struct jaylink_context *ctx,
if (!ctx)
return JAYLINK_ERR_ARG;
- if (level > JAYLINK_LOG_LEVEL_DEBUG)
+ if (level > JAYLINK_LOG_LEVEL_DEBUG_IO)
return JAYLINK_ERR_ARG;
ctx->log_level = level;
@@ -249,3 +249,18 @@ JAYLINK_PRIV void log_dbg(const struct jaylink_context *ctx,
ctx->log_callback_data);
va_end(args);
}
+
+/** @private */
+JAYLINK_PRIV void log_dbgio(const struct jaylink_context *ctx,
+ const char *format, ...)
+{
+ va_list args;
+
+ if (!ctx)
+ return;
+
+ va_start(args, format);
+ ctx->log_callback(ctx, JAYLINK_LOG_LEVEL_DEBUG_IO, format, args,
+ ctx->log_callback_data);
+ va_end(args);
+}