globus_common  17.11
globus_logging.h
Go to the documentation of this file.
1 
7 #ifndef GLOBUS_LOGGING_H
8 #define GLOBUS_LOGGING_H 1
9 
10 #include "globus_common_include.h"
11 #include "globus_time.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #define GLOBUS_LOGGING_INLINE 0x08000000
18 
19 typedef struct globus_l_logging_handle_s * globus_logging_handle_t;
20 
21 typedef enum
22 {
23  GLOBUS_LOGGING_ERROR_PARAMETER,
24  GLOBUS_LOGGING_ERROR_ALLOC
25 } globus_logging_error_type_t;
26 
27 typedef void
28 (*globus_logging_open_func_t)(
29  void * user_arg);
30 
31 typedef void
32 (*globus_logging_write_func_t)(
33  globus_byte_t * buf,
34  globus_size_t length,
35  void * user_arg);
36 
37 typedef void
38 (*globus_logging_close_func_t)(
39  void * user_arg);
40 
41 typedef void
42 (*globus_logging_header_func_t)(
43  char * buffer,
44  globus_size_t * buf_len);
45 
46 typedef struct globus_logging_module_s
47 {
48  globus_logging_open_func_t open_func;
49  globus_logging_write_func_t write_func;
50  globus_logging_close_func_t close_func;
51  globus_logging_header_func_t header_func;
52 } globus_logging_module_t;
53 
54 void
56 
58 globus_logging_init(
59  globus_logging_handle_t * out_handle,
60  globus_reltime_t * flush_period,
61  int buffer_length,
62  int log_type,
63  globus_logging_module_t * module,
64  void * user_arg);
65 
67 globus_logging_write(
68  globus_logging_handle_t handle,
69  int type,
70  const char * fmt,
71  ...);
72 
74 globus_logging_vwrite(
75  globus_logging_handle_t handle,
76  int type,
77  const char * fmt,
78  va_list ap);
79 
81 globus_logging_flush(
82  globus_logging_handle_t handle);
83 
85 globus_logging_destroy(
86  globus_logging_handle_t handle);
87 
88 extern globus_logging_module_t globus_logging_stdio_module;
89 extern globus_logging_module_t globus_logging_syslog_module;
90 extern globus_logging_module_t globus_logging_stdio_ng_module;
91 extern globus_logging_module_t globus_logging_syslog_ng_module;
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* GLOBUS_LOGGING_H */
Include System Headers.
void globus_logging_update_pid(void)
Definition: globus_logging.c:119
Time Types and Macros.
unsigned char globus_byte_t
Unsigned byte datatypeThis is used for byte-addressable arrays of arbitrary data which is not subject...
Definition: globus_types.h:70
uint32_t globus_result_t
Definition: globus_types.h:84
size_t globus_size_t
Standard size of memory objectThe globus_size_t is the size of a memory object. It is identical to si...
Definition: globus_types.h:33