Grid Community Toolkit  6.2.1653033972 (tag: v6.2.20220524)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_logging.h
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
22 #ifndef GLOBUS_LOGGING_H
23 #define GLOBUS_LOGGING_H 1
24 
25 #include "globus_common_include.h"
26 #include "globus_time.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define GLOBUS_LOGGING_INLINE 0x08000000
33 
34 typedef struct globus_l_logging_handle_s * globus_logging_handle_t;
35 
36 typedef enum
37 {
38  GLOBUS_LOGGING_ERROR_PARAMETER,
39  GLOBUS_LOGGING_ERROR_ALLOC
40 } globus_logging_error_type_t;
41 
42 typedef void
43 (*globus_logging_open_func_t)(
44  void * user_arg);
45 
46 typedef void
47 (*globus_logging_write_func_t)(
48  globus_byte_t * buf,
49  globus_size_t length,
50  void * user_arg);
51 
52 typedef void
53 (*globus_logging_close_func_t)(
54  void * user_arg);
55 
56 typedef void
57 (*globus_logging_header_func_t)(
58  char * buffer,
59  globus_size_t * buf_len);
60 
61 typedef struct globus_logging_module_s
62 {
63  globus_logging_open_func_t open_func;
64  globus_logging_write_func_t write_func;
65  globus_logging_close_func_t close_func;
66  globus_logging_header_func_t header_func;
67 } globus_logging_module_t;
68 
69 void
71 
73 globus_logging_init(
74  globus_logging_handle_t * out_handle,
75  globus_reltime_t * flush_period,
76  int buffer_length,
77  int log_type,
78  globus_logging_module_t * module,
79  void * user_arg);
80 
82 globus_logging_write(
83  globus_logging_handle_t handle,
84  int type,
85  const char * fmt,
86  ...);
87 
89 globus_logging_vwrite(
90  globus_logging_handle_t handle,
91  int type,
92  const char * fmt,
93  va_list ap);
94 
96 globus_logging_flush(
97  globus_logging_handle_t handle);
98 
100 globus_logging_destroy(
101  globus_logging_handle_t handle);
102 
103 extern globus_logging_module_t globus_logging_stdio_module;
104 extern globus_logging_module_t globus_logging_syslog_module;
105 extern globus_logging_module_t globus_logging_stdio_ng_module;
106 extern globus_logging_module_t globus_logging_syslog_ng_module;
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* GLOBUS_LOGGING_H */
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:48
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:85
uint32_t globus_result_t
Definition: globus_types.h:99
void globus_logging_update_pid(void)
Definition: globus_logging.c:134
Time Types and Macros.
Include System Headers.