yumapro  20.10-12
YumaPro SDK
log_syslog.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #ifndef _H_log_syslog
12 #define _H_log_syslog
13 /* FILE: log_syslog.h
14 *********************************************************************
15 * *
16 * P U R P O S E *
17 * *
18 *********************************************************************/
19 
25 /*********************************************************************
26 * *
27 * C H A N G E H I S T O R Y *
28 * *
29 *********************************************************************
30 
31 date init comment
32 ----------------------------------------------------------------------
33 08-jan-06 abb begun
34 02-jun-2012 mts adapted from log.h
35 */
36 
37 #include <stdio.h>
38 #include <xmlstring.h>
39 
40 #include "procdefs.h"
41 #include "status.h"
42 #include "log.h"
43 #include "log.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /********************************************************************
50 * *
51 * C O N S T A N T S *
52 * *
53 *********************************************************************/
54 #define LOG_SYSLOG_PRIO_NONE -1;
55 
56 /********************************************************************
57 * *
58 * T Y P E S *
59 * *
60 *********************************************************************/
61 
62 /********************************************************************
63 * *
64 * F U N C T I O N S *
65 * *
66 *********************************************************************/
67 
68  // BEGIN ncxlib/log/syslog
77 
78 
83 extern void
84  log_syslog_close (void);
85 
86 
94 void
95  log_syslog_cleanup (void);
96 
97 
98 
105 extern int
106  cvt_level2syslog_prio (log_debug_t level);
107 
108 
114 extern boolean
115  log_syslog_connected (void);
116 
117 
122 extern void
123  log_syslog_connect (void);
124 
125 
136 extern void
137  log_syslog_send (log_debug_app_t app,
138  log_debug_t level,
139  const char *fstr, ...)
140  __attribute__ ((format (printf, 3, 4)));
141 
142 
147 extern void
148  log_syslog_flush (void);
149 
150 
161 extern void
162  log_syslog_common (boolean recursive,
163  log_debug_t level,
164  log_debug_t sub_level,
165  const char *fstr,
166  va_list args);
167 
168 
179 extern void
180  log_syslog_append (boolean recursive,
181  log_debug_t level,
182  log_debug_t sub_level,
183  const char *fstr,
184  va_list args);
185 
186 
189 #ifdef __cplusplus
190 } /* end extern 'C' */
191 #endif
192 
193 #endif /* _H_log_syslog */
log_syslog_cleanup
void log_syslog_cleanup(void)
Cleanup syslog related logging state, if any.
Definition: log_syslog.c:145
tstamp.h
Timestamp utilities.
LOG_DEBUG_DEBUG4
@ LOG_DEBUG_DEBUG4
debug level 4
Definition: log.h:397
LOG_DEBUG_NONE
@ LOG_DEBUG_NONE
value not set or error
Definition: log.h:386
xml_util.h
XML Utilities.
log_util_logbuf_common
void log_util_logbuf_common(syslog_msg_desc_t *desc, log_debug_app_t app, log_debug_t level, log_debug_t sub_level, const char *fstr, va_list args)
Send formatted string output to an internal log buffer.
Definition: log_util.c:549
log_util_init_buf
void log_util_init_buf(syslog_msg_desc_t *dp)
Initialize the contents of an internal log buffer descriptor.
Definition: log_util.c:88
log_syslog.h
Syslog logging manager API.
cvt_level2syslog_prio
int cvt_level2syslog_prio(log_debug_t level)
Convert from log_debug (native) level to syslog priority.
Definition: log_syslog.c:87
log_syslog_append
void log_syslog_append(boolean recursive, log_debug_t level, log_debug_t sub_level, const char *fstr, va_list args)
Append formatted string output to the internal syslog log buffer.
Definition: log_syslog.c:309
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
LOG_DEBUG_WARN
@ LOG_DEBUG_WARN
all errors + warnings
Definition: log.h:391
LOG_DEBUG_WRITE
@ LOG_DEBUG_WRITE
logging turned on
Definition: log.h:388
log_syslog_send
void log_syslog_send(log_debug_app_t app, log_debug_t level, const char *fstr,...) __attribute__((format(printf
Send log data to syslog via vsyslog()
LOG_DEBUG_DEBUG2
@ LOG_DEBUG_DEBUG2
debug level 2
Definition: log.h:395
LOG_DEBUG_DEV1
@ LOG_DEBUG_DEV1
Special use developer debugging only.
Definition: log.h:393
log_syslog_common
void log_syslog_common(boolean recursive, log_debug_t level, log_debug_t sub_level, const char *fstr, va_list args)
Generate a log entry destined for vendor specific processing.
Definition: log_syslog.c:247
log_syslog_connect
void log_syslog_connect(void)
Connect to syslog output stream via openlog()
Definition: log_syslog.c:178
LOG_DEBUG_ERROR
@ LOG_DEBUG_ERROR
fatal + internal errors only
Definition: log.h:390
LOG_DEBUG_OFF
@ LOG_DEBUG_OFF
logging turned off
Definition: log.h:387
log.h
NCX System Logging Manager.
log_syslog_flush
void log_syslog_flush(void)
Flush contents of internal buffer to vendor logging system.
Definition: log_syslog.c:225
LOG_DEBUG_DEV0
@ LOG_DEBUG_DEV0
Special use developer debugging only.
Definition: log.h:389
log_syslog_connected
boolean log_syslog_connected(void)
Return syslog connect status.
Definition: log_syslog.c:165
ncx.h
YANG module utility functions.
LOG_DEBUG_DEBUG
@ LOG_DEBUG_DEBUG
debug level 1
Definition: log.h:394
LOG_DEBUG_DEBUG3
@ LOG_DEBUG_DEBUG3
debug level 3
Definition: log.h:396
LOG_DEBUG_INFO
@ LOG_DEBUG_INFO
all previous + user info trace
Definition: log.h:392
log_util_logbuf_append
void log_util_logbuf_append(syslog_msg_desc_t *desc, log_debug_app_t app, log_debug_t level, log_debug_t sub_level, const char *fstr, va_list args)
Append formatted string output to an internal log buffer.
Definition: log_util.c:588
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
log_util_flush
void log_util_flush(syslog_msg_desc_t *desc)
Flush contents of internal buffer to external logging system.
Definition: log_util.c:525
log_util.h
Internal SYSLOG Logging support.
log_syslog_close
void log_syslog_close(void)
Close down syslog connection.
Definition: log_syslog.c:125
status.h
Global error messages for status code enumerations.