adding a callback definition for logging
[platform/upstream/libsolv.git] / src / sat_debug.h
1 /*
2  * Copyright (c) 2007, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  *
7  * debug.h
8  * general logging function
9  *
10  */
11
12 #ifndef _SAT_DEBUG_H
13 #define _SAT_DEBUG_H
14
15 #include <stdarg.h>
16 #include <stdio.h>
17
18 typedef enum {
19     NONE     = -2,
20     ALWAYS   = -1,
21     ERROR    = 0,
22     DEBUG_1  = 1,
23     DEBUG_2  = 2,
24     DEBUG_3  = 3,
25     DEBUG_4  = 4,
26     DEBUG_5  = 5
27 } DebugLevel;
28
29 // Callback for logging
30 typedef void (*SatDebugFn) (char *logString);
31 void sat_set_debugCallback (SatDebugFn callback);
32
33 // debug level
34 void sat_set_debug (DebugLevel level, int log_line_nr);
35 DebugLevel sat_debug_level ();
36
37 // logging a line
38 void sat_debug (DebugLevel  level, const char *format, ...);
39
40 #endif /* _SAT_DEBUG_H */