yumapro  20.10-12
YumaPro SDK
log_vendor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 - 2021, 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_vendor
12 #define _H_log_vendor
13 /* FILE: log_vendor.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_util.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 
55 /********************************************************************
56 * *
57 * T Y P E S *
58 * *
59 *********************************************************************/
60 
61 /********************************************************************
62 * *
63 * F U N C T I O N S *
64 * *
65 *********************************************************************/
66  // BEGIN ncxlib/log/log-vendor
72 
73 
81 extern void
82  log_vendor_cleanup ( void );
83 
84 
88 extern void
89  log_vendor_connect (void);
90 
91 
105 extern void
106  log_vendor_send_to_syslog (log_debug_app_t app,
107  log_debug_t level,
108  const char *fstr,
109  va_list args);
110 
111 
123 extern void
124  log_vendor_test_send_to_syslog (log_debug_app_t app,
125  log_debug_t level,
126  const char *fstr,
127  va_list args);
128 
129 
140 extern void
141  log_vendor_send (log_debug_app_t app,
142  log_debug_t level,
143  const char *fstr, ...)
144  __attribute__ ((format (printf, 3, 4)));
145 
146 
150 extern void
151  log_vendor_flush (void);
152 
153 
163 extern void
164  log_vendor_common (boolean recursive,
165  log_debug_t level,
166  log_debug_t sub_level,
167  const char *fstr,
168  va_list args);
169 
170 
180 extern void
181  log_vendor_append (boolean recursive,
182  log_debug_t level,
183  log_debug_t sub_level,
184  const char *fstr,
185  va_list args);
186 
187 
190 #ifdef __cplusplus
191 } /* end extern 'C' */
192 #endif
193 
194 #endif /* _H_log_vendor */
log_vendor_send
void log_vendor_send(log_debug_app_t app, log_debug_t level, const char *fstr,...) __attribute__((format(printf
Send log data to vendor log output stream.
log_vendor_append
void log_vendor_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 vendor log buffer.
Definition: log_vendor.c:296
tstamp.h
Timestamp utilities.
log_vendor_common
void log_vendor_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_vendor.c:217
xml_util.h
XML Utilities.
log_vendor.h
Logging manager vendor API.
log_vendor_connect
void log_vendor_connect(void)
Connect to vendor log output stream (implementation TBD).
Definition: log_vendor.c:110
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_vendor_extern_register_send_fn
void log_vendor_extern_register_send_fn(logfn_vendor_send_t new_vendor_logfn)
Register vendor function to accept YumaPro log output stream (mandatory)
Definition: log_vendor_extern.c:94
log_vendor_flush
void log_vendor_flush(void)
Flush contents of internal buffer to vendor logging system.
Definition: log_vendor.c:194
log_vendor_extern.h
Logging manager vendor API registration.
log_syslog.h
Syslog logging manager API.
log_vendor_send_to_syslog
void log_vendor_send_to_syslog(log_debug_app_t app, log_debug_t level, const char *fstr, va_list args)
Send vendor log data to syslog output stream.
Definition: log_vendor.c:127
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_vendor_test_send_to_syslog
void log_vendor_test_send_to_syslog(log_debug_app_t app, log_debug_t level, const char *fstr, va_list args)
Pass vendor log data to syslog, but pretend to be a vendor callback.
Definition: log_vendor.c:156
LOG_DEBUG_WRITE
@ LOG_DEBUG_WRITE
logging turned on
Definition: log.h:388
log_syslog_connect
void log_syslog_connect(void)
Connect to syslog output stream via openlog()
Definition: log_syslog.c:178
log_vendor_cleanup
void log_vendor_cleanup(void)
Cleanup vendor related logging state, if any.
Definition: log_vendor.c:90
log.h
NCX System Logging Manager.
log_syslog_connected
boolean log_syslog_connected(void)
Return syslog connect status.
Definition: log_syslog.c:165
ncx.h
YANG module utility functions.
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
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.
status.h
Global error messages for status code enumerations.