diff options
Diffstat (limited to 'jnlib/logging.h')
-rw-r--r-- | jnlib/logging.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/jnlib/logging.h b/jnlib/logging.h index 83158f0b..7b7b8c8a 100644 --- a/jnlib/logging.h +++ b/jnlib/logging.h @@ -24,9 +24,12 @@ #include <stdio.h> #include "mischelp.h" + int log_get_errorcount (int clear); void log_set_file( const char *name ); +void log_set_prefix (const char *text, unsigned int flags); int log_get_fd(void); +FILE *log_get_stream (void); #ifdef JNLIB_GCC_M_FUNCTION void bug_at( const char *file, int line, const char *func ) JNLIB_GCC_A_NR; @@ -36,12 +39,36 @@ int log_get_fd(void); # define BUG() bug_at( __FILE__ , __LINE__ ) #endif +/* To avoid mandatory inclusion of stdarg and other stuff, do it only + if explicitly requested to do so. */ +#ifdef JNLIB_NEED_LOG_LOGV +#include <stdarg.h> +enum jnlib_log_levels { + JNLIB_LOG_BEGIN, + JNLIB_LOG_CONT, + JNLIB_LOG_INFO, + JNLIB_LOG_WARN, + JNLIB_LOG_ERROR, + JNLIB_LOG_FATAL, + JNLIB_LOG_BUG, + JNLIB_LOG_DEBUG +}; +void log_logv (int level, const char *fmt, va_list arg_ptr); +#endif /*JNLIB_NEED_LOG_LOGV*/ + + void log_bug( const char *fmt, ... ) JNLIB_GCC_A_NR_PRINTF(1,2); void log_fatal( const char *fmt, ... ) JNLIB_GCC_A_NR_PRINTF(1,2); void log_error( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); void log_info( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); void log_debug( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); void log_printf( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); +void log_printhex (const char *text, const void *buffer, size_t length); #endif /*LIBJNLIB_LOGGING_H*/ + + + + + |