yumapro
24.10-1
YumaPro SDK
|
This is the vendor API type for receiving log messages from YumaPro. More...
Typedefs | |
typedef void(* | logfn_vendor_init1_t) (boolean pre_cli) |
Vendor Logging Init1 Callback. More... | |
typedef void(* | logfn_vendor_send_t) (log_debug_app_t app, log_debug_t level, const char *fstr, va_list args) |
Vendor Logging Send Callback. More... | |
typedef void(* | logfn_vendor_cleanup_t) (void) |
Vendor Logging Cleanup Callback. More... | |
Functions | |
void | log_vendor_cleanup (void) |
Cleanup vendor related logging state, if any. More... | |
void | log_vendor_connect (void) |
Connect to vendor log output stream (implementation TBD). | |
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. More... | |
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. More... | |
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. More... | |
void void | log_vendor_flush (void) |
Flush contents of internal buffer to vendor logging system. | |
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. More... | |
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. More... | |
void | log_vendor_extern_register_send_fn (logfn_vendor_send_t new_vendor_logfn) |
Register vendor function to accept YumaPro log output stream (mandatory) More... | |
This is the vendor API type for receiving log messages from YumaPro.
Vendor will create a function of this type and register it via
log_vendor_register_send_fn (logfn_vendor_send_t vendor_logfn)
This should be done very early in the YumaPro initialization process in order not to miss log messages issued during the initialization, i.e., before the call on bootstrap_cli() by ncx_init().
When the vendor callback is invoked, the vendor code should translate the YumaPro app param into an "application" and/or "facility" equivalent appropriate to the vendor logging schema. Likewise, it should translate the YumaPro level param into a "message type/level" appropriate to its own requirements.
typedef void(* logfn_vendor_cleanup_t) (void) |
Vendor Logging Cleanup Callback.
THIS CALLBACK IS NOT USED
typedef void(* logfn_vendor_init1_t) (boolean pre_cli) |
Vendor Logging Init1 Callback.
THIS CALLBACK IS NOT USED
pre_cli | called before and after CLI is processed |
typedef void(* logfn_vendor_send_t) (log_debug_app_t app, log_debug_t level, const char *fstr, va_list args) |
Vendor Logging Send Callback.
app | YumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect. |
level | YumaPro log message level. This will be translated appropriately into a syslog equivalent |
fstr | start ptr to format string |
args | va_list |
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.
recursive | TRUE if a recursive call |
level | YumaPro log level |
sub_level | == YumaPro log sub-level |
fstr | format string in printf format |
args | any additional arguments for printf |
void log_vendor_cleanup | ( | void | ) |
Cleanup vendor related logging state, if any.
Note: Invocation should be delayed to the LAST POSSIBLE MOMENT. This is because the various cleanup routines often want to log errors/warnings/info as well various debugs using standard logging.
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.
recursive | TRUE if a recursive call |
level | YumaPro log level |
sub_level | == YumaPro log sub-level |
fstr | format string in printf format |
args | any additional arguments for printf |
void log_vendor_extern_register_send_fn | ( | logfn_vendor_send_t | new_vendor_logfn | ) |
Register vendor function to accept YumaPro log output stream (mandatory)
THIS IS THE VENDOR API FUNCTION
This is the manditory vendor API registration function for receiving log messages from YumaPro. This should be called very early in the YumaPro initialization process in order not to miss log messages issued during initialization (e.g. before bootstrap_cli() in ncx_init()).
new_vendor_logfn | Send callback function to register |
void log_vendor_send | ( | log_debug_app_t | app, |
log_debug_t | level, | ||
const char * | fstr, | ||
... | |||
) |
Send log data to vendor log output stream.
app | YumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect. |
level | YumaPro log message level. This will be translated appropriately into a syslog equivalent |
fstr | start ptr to format string |
... | va_list |
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.
This is used to allow internal testing of the –log-vendor param when no actual vendor callback is present.
app | YumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect. |
level | YumaPro log message level. This will be translated appropriately into a syslog equivalent |
fstr | start ptr to format string |
args | va_list |
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.
This is for internal testing only.
app | YumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect. |
level | YumaPro log message level. This will be translated appropriately into a syslog equivalent |
fstr | start ptr to format string |
args | va_list |