]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/utils/logging.h
c2523af9d58ffeb395b4f5f21720f2c1523d4389
[OpenSRF.git] / src / utils / logging.h
1
2 #include <stdarg.h>
3 #include <fcntl.h>
4 #include <unistd.h>
5 #include <sys/time.h>
6 #include <sys/stat.h>
7 #include <fcntl.h>
8 #include <stdio.h>
9 #include <sys/timeb.h>
10
11 #include <string.h>
12 #include <time.h>
13 #include <stdlib.h>
14
15 #ifndef LOGGING_H
16 #define LOGGING_H
17
18
19 #define LOG_ERROR 1
20 #define LOG_WARNING 2
21 #define LOG_INFO 3
22 #define LOG_DEBUG 4
23
24 // ---------------------------------------------------------------------------------
25 // Error handling interface.
26 // ---------------------------------------------------------------------------------
27 void get_timestamp(     char buf_36chars[]);
28 int fatal_handler(      char* message, ...);
29 int warning_handler( char* message, ... );
30 int info_handler(               char* message, ... );
31 int debug_handler(      char* message, ... );
32
33
34 /** If we return 0 either the log level is less than LOG_ERROR  
35   * or we could not open the log file
36   */
37 int log_init( int log_level, char* log_file );
38 void log_free(); 
39
40 #endif