diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-06-12 00:43:49 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-06-12 00:43:49 +0000 |
commit | a9b673cd4a9a5ee64d8d04f5e3c03978a799f837 (patch) | |
tree | 9e53f873a2384b92f9378dd1a4a78a602708cefe /bindings | |
parent | c4ac4f652c0a3646ee12c9d947e6eada70315ebb (diff) | |
download | lasso-a9b673cd4a9a5ee64d8d04f5e3c03978a799f837.tar.gz lasso-a9b673cd4a9a5ee64d8d04f5e3c03978a799f837.tar.xz lasso-a9b673cd4a9a5ee64d8d04f5e3c03978a799f837.zip |
Core: move logging function and macros to their own module, adapt perl binding
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/perl/lang.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bindings/perl/lang.py b/bindings/perl/lang.py index 64e9d189..f01c88ba 100644 --- a/bindings/perl/lang.py +++ b/bindings/perl/lang.py @@ -141,10 +141,31 @@ GHashTable*\tT_PTRREF #include "XSUB.h" #include <stdio.h> +#if defined(__GNUC__) +# define lasso_log(level, filename, line, function, format, args...) \ + g_log("Lasso", level, "%s:%i:%s" format, filename, line, function, ##args) +#elif defined(HAVE_VARIADIC_MACROS) +# define lasso_log(level, format, line, function, ...) \ + g_log("Lasso", leve, "%s:%i:%s" format, filename, line, function, __VA_ARGS__) +#else +static inline void lasso_log(GLogLevelFlags level, const char *filename, + int line, const char *function, const char *format, ...) +{ + va_list ap; + char s[1024]; + va_start(ap, format); + g_vsnprintf(s, 1024, format, ap); + va_end(ap); + g_log("Lasso", level, "%s:%i:%s %s", filename, line, function, s); +} +#define lasso_log lasso_log +#endif + #include "./gobject_handling.c" #include "./glist_handling.c" #include "./ghashtable_handling.c" + #define lasso_assign_simple(a,b) a = b; typedef char* string_non_null; |