]> git.evergreen-ils.org Git - Evergreen.git/blob - OpenSRF/src/utils/logging.h
moved C code to a unified logging framework which currently supports syslogging and...
[Evergreen.git] / OpenSRF / 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 OSRF_LOG_ERROR 1
20 #define OSRF_LOG_WARNING 2
21 #define OSRF_LOG_INFO 3
22 #define OSRF_LOG_DEBUG 4
23 #define OSRF_LOG_INTERNAL 5
24 #define OSRF_LOG_ACTIVITY 6
25
26 // ---------------------------------------------------------------------------------
27 // Error handling interface.
28 // ---------------------------------------------------------------------------------
29 void get_timestamp(     char buf_36chars[]);
30 int fatal_handler(      char* message, ...);
31 int warning_handler( char* message, ... );
32 int info_handler(               char* message, ... );
33 int debug_handler(      char* message, ... );
34
35
36 /** If we return 0 either the log level is less than LOG_ERROR  
37   * or we could not open the log file
38   */
39 int log_init( int log_level, char* log_file );
40 void log_free(); 
41
42 #endif