00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00022 #ifndef GLOBUS_LOGGING_H
00023 #define GLOBUS_LOGGING_H 1
00024
00025 #include "globus_common_include.h"
00026 #include "globus_time.h"
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 #define GLOBUS_LOGGING_INLINE 0x08000000
00033
00034 typedef struct globus_l_logging_handle_s * globus_logging_handle_t;
00035
00036 typedef enum
00037 {
00038 GLOBUS_LOGGING_ERROR_PARAMETER,
00039 GLOBUS_LOGGING_ERROR_ALLOC
00040 } globus_logging_error_type_t;
00041
00042 typedef void
00043 (*globus_logging_open_func_t)(
00044 void * user_arg);
00045
00046 typedef void
00047 (*globus_logging_write_func_t)(
00048 globus_byte_t * buf,
00049 globus_size_t length,
00050 void * user_arg);
00051
00052 typedef void
00053 (*globus_logging_close_func_t)(
00054 void * user_arg);
00055
00056 typedef void
00057 (*globus_logging_header_func_t)(
00058 char * buffer,
00059 globus_size_t * buf_len);
00060
00061 typedef struct globus_logging_module_s
00062 {
00063 globus_logging_open_func_t open_func;
00064 globus_logging_write_func_t write_func;
00065 globus_logging_close_func_t close_func;
00066 globus_logging_header_func_t header_func;
00067 } globus_logging_module_t;
00068
00069 void
00070 globus_logging_update_pid(void);
00071
00072 globus_result_t
00073 globus_logging_init(
00074 globus_logging_handle_t * out_handle,
00075 globus_reltime_t * flush_period,
00076 int buffer_length,
00077 int log_type,
00078 globus_logging_module_t * module,
00079 void * user_arg);
00080
00081 globus_result_t
00082 globus_logging_write(
00083 globus_logging_handle_t handle,
00084 int type,
00085 const char * fmt,
00086 ...);
00087
00088 globus_result_t
00089 globus_logging_vwrite(
00090 globus_logging_handle_t handle,
00091 int type,
00092 const char * fmt,
00093 va_list ap);
00094
00095 globus_result_t
00096 globus_logging_flush(
00097 globus_logging_handle_t handle);
00098
00099 globus_result_t
00100 globus_logging_destroy(
00101 globus_logging_handle_t handle);
00102
00103 extern globus_logging_module_t globus_logging_stdio_module;
00104 extern globus_logging_module_t globus_logging_syslog_module;
00105 extern globus_logging_module_t globus_logging_stdio_ng_module;
00106 extern globus_logging_module_t globus_logging_syslog_ng_module;
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112 #endif