yumapro  20.10-14
YumaPro SDK
Vendor Logging

This is the vendor API type for receiving log messages from YumaPro. More...

Collaboration diagram for Vendor Logging:

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...
 

Detailed Description

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 Documentation

◆ logfn_vendor_cleanup_t

typedef void(* logfn_vendor_cleanup_t) (void)

Vendor Logging Cleanup Callback.

◆ logfn_vendor_init1_t

typedef void(* logfn_vendor_init1_t) (boolean pre_cli)

Vendor Logging Init1 Callback.

Parameters
pre_clicalled before and after CLI is processed

◆ logfn_vendor_send_t

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.

Parameters
appYumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect.
levelYumaPro log message level. This will be translated appropriately into a syslog equivalent
fstrstart ptr to format string
argsva_list

Function Documentation

◆ 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.

Parameters
recursiveTRUE if a recursive call
levelYumaPro log level
sub_level== YumaPro log sub-level
fstrformat string in printf format
argsany additional arguments for printf

◆ log_vendor_cleanup()

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.

Here is the caller graph for this function:

◆ 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.

Parameters
recursiveTRUE if a recursive call
levelYumaPro log level
sub_level== YumaPro log sub-level
fstrformat string in printf format
argsany additional arguments for printf

◆ 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)

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()).

Parameters
new_vendor_logfnSend callback function to register

◆ log_vendor_send()

void log_vendor_send ( log_debug_app_t  app,
log_debug_t  level,
const char *  fstr,
  ... 
)

Send log data to vendor log output stream.

Parameters
appYumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect.
levelYumaPro log message level. This will be translated appropriately into a syslog equivalent
fstrstart ptr to format string
...va_list
Here is the caller graph for this function:

◆ 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.

This is used to allow internal testing of the –log-vendor param when no actual vendor callback is present.

Parameters
appYumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect.
levelYumaPro log message level. This will be translated appropriately into a syslog equivalent
fstrstart ptr to format string
argsva_list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

This is for internal testing only.

Parameters
appYumaPro application (such as netconfd-pro or yangcli-pro) This info is already known to syslog via the connect.
levelYumaPro log message level. This will be translated appropriately into a syslog equivalent
fstrstart ptr to format string
argsva_list
Here is the call graph for this function: