summaryrefslogtreecommitdiff
path: root/libgphoto2_port/gphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-09-09 07:41:27 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-09-09 07:41:27 +0000
commit38fba13e73ce3e6cf7799ca6e1879f7c00699400 (patch)
tree9fecfaee5b4ad789d5110dda3855028da43ec269 /libgphoto2_port/gphoto2
parente0918485d11ab958f9d5c8d24101c3f1acd8cfec (diff)
downloadlibgphoto2-38fba13e73ce3e6cf7799ca6e1879f7c00699400.tar.gz
From: Axel Waggershauser <awagger@web.de>
condense gp_log_data debug output. - changed gp_log_data to take a printf style debug string -> new major version of libgphoto2_port - adjusted all callers git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15175 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/gphoto2')
-rw-r--r--libgphoto2_port/gphoto2/gphoto2-port-log.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/libgphoto2_port/gphoto2/gphoto2-port-log.h b/libgphoto2_port/gphoto2/gphoto2-port-log.h
index 80bf9b7f9..521091d8c 100644
--- a/libgphoto2_port/gphoto2/gphoto2-port-log.h
+++ b/libgphoto2_port/gphoto2/gphoto2-port-log.h
@@ -85,7 +85,12 @@ void gp_logv (GPLogLevel level, const char *domain, const char *format,
__attribute__((__format__(printf,3,0)))
#endif
;
-void gp_log_data (const char *domain, const char *data, unsigned int size);
+void gp_log_data (const char *domain, const char *data, unsigned int size,
+ const char *format, ...)
+#ifdef __GNUC__
+__attribute__((__format__(printf,4,5)))
+#endif
+;
/*
* GP_DEBUG:
@@ -110,7 +115,7 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
*/
#define GP_LOG_D(...) gp_log(GP_LOG_DEBUG, __func__, __VA_ARGS__)
#define GP_LOG_E(...) gp_log_with_source_location(GP_LOG_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__)
-#define GP_LOG_DATA(DATA, SIZE) gp_log_data(__func__, DATA, SIZE)
+#define GP_LOG_DATA(DATA, SIZE, MSG, ...) gp_log_data(__func__, DATA, SIZE, MSG, ##__VA_ARGS__)
#elif defined(__GNUC__) && __GNUC__ >= 2
#define GP_DEBUG(msg, params...) \
@@ -122,7 +127,7 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
*/
#define GP_LOG_D(...) gp_log(GP_LOG_DEBUG, __func__, __VA_ARGS__)
#define GP_LOG_E(...) gp_log_with_source_location(GP_LOG_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__)
-#define GP_LOG_DATA(DATA, SIZE) gp_log_data(__func__, DATA, SIZE)
+#define GP_LOG_DATA(DATA, SIZE, MSG, ...) gp_log_data(__func__, DATA, SIZE, MSG, ##__VA_ARGS__)
#else
# ifdef __GNUC__
@@ -131,7 +136,7 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
#define GP_DEBUG (void)
#define GP_LOG_D(...) /* no-op */
#define GP_LOG_E(...) /* no-op */
-#define GP_LOG_DATA(DATA, SIZE) /* no-op */
+#define GP_LOG_DATA(DATA, SIZE, ...) /* no-op */
#endif
#endif /* _GPHOTO2_INTERNAL_CODE */
@@ -150,18 +155,18 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
#define GP_DEBUG(...) /* no-op */
#define GP_LOG_D(...) /* no-op */
#define GP_LOG_E(...) /* no-op */
-#define GP_LOG_DATA(DATA, SIZE) /* no-op */
+#define GP_LOG_DATA(DATA, SIZE, ...) /* no-op */
#elif defined(__GNUC__)
#define GP_DEBUG(msg, params...) /* no-op */
#define GP_LOG_D(...) /* no-op */
#define GP_LOG_E(...) /* no-op */
-#define GP_LOG_DATA(DATA, SIZE) /* no-op */
+#define GP_LOG_DATA(DATA, SIZE, ...) /* no-op */
#else
#define GP_DEBUG (void)
#define GP_LOG_D (void /* no-op */
#define GP_LOG_E (void) /* no-op */
-#define GP_LOG_DATA(DATA, SIZE) /* no-op */
+#define GP_LOG_DATA(void) /* no-op */
#endif
#endif /* _GPHOTO2_INTERNAL_CODE */
@@ -202,7 +207,7 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
unsigned int
gpi_string_list_to_flags(const char *str[],
const StringFlagItem *map);
-
+
#define C_MEM(MEM) do {\
if ((MEM) == NULL) {\
GP_LOG_E ("Out of memory: '%s' failed.", #MEM);\