]> git.evergreen-ils.org Git - OpenSRF.git/blob - include/opensrf/log.h
Add doxygen-style comments to document all functions and all variables
[OpenSRF.git] / include / opensrf / log.h
1 #ifndef OSRF_LOG_INCLUDED
2 #define OSRF_LOG_INCLUDED
3
4 /**
5         @file log.h
6         @brief Header for logging routines.
7 */
8
9 #include <opensrf/utils.h>
10
11 #include <syslog.h>
12 #include <stdio.h>
13 #include <time.h>
14 #include <errno.h>
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 /* log levels */
21 #define OSRF_LOG_ERROR 1
22 #define OSRF_LOG_WARNING 2
23 #define OSRF_LOG_INFO 3
24 #define OSRF_LOG_DEBUG 4
25 #define OSRF_LOG_INTERNAL 5
26 #define OSRF_LOG_ACTIVITY -1
27
28 #define OSRF_LOG_TYPE_FILE 1
29 #define OSRF_LOG_TYPE_SYSLOG 2
30 #define OSRF_LOG_TYPE_STDERR 3
31
32 #define OSRF_LOG_MARK __FILE__, __LINE__
33
34 void osrfLogInit( int type, const char* appname, int maxlevel );
35
36 void osrfLogSetSyslogFacility( int facility );
37
38 void osrfLogSetSyslogActFacility( int facility );
39
40 void osrfLogToStderr( void );
41
42 void osrfRestoreLogType( void );
43
44 void osrfLogSetFile( const char* logfile );
45
46 void osrfLogSetAppname( const char* appname );
47
48 void osrfLogSetLevel( int loglevel );
49
50 int osrfLogGetLevel( void );
51
52 void osrfLogError( const char* file, int line, const char* msg, ... );
53
54 void osrfLogWarning( const char* file, int line, const char* msg, ... );
55
56 void osrfLogInfo( const char* file, int line, const char* msg, ... );
57
58 void osrfLogDebug( const char* file, int line, const char* msg, ... );
59
60 void osrfLogInternal( const char* file, int line, const char* msg, ... );
61
62 void osrfLogActivity( const char* file, int line, const char* msg, ... );
63
64 void osrfLogCleanup( void );
65
66 void osrfLogClearXid( void );
67
68 void osrfLogSetXid(char* xid);
69
70 void osrfLogForceXid(char* xid);
71
72 void osrfLogMkXid( void );
73
74 void osrfLogSetIsClient(int is);
75
76 const char* osrfLogGetXid( void );
77
78 void osrfLogSetActivityEnabled( int enabled );
79
80 int osrfLogFacilityToInt( const char* facility );
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 #endif