yumapro
24.10-3
YumaPro SDK
|
Configure logging and write to the various logging streams. More...
Functions | |
void | disable_default_stdout (void) |
Used by yp-client to disable log.c output. | |
void | enable_default_stdout (void) |
Used by C program variants of yp-client to enable log.c output. | |
void | log_cleanup (boolean phase2, boolean debugs) |
Final logger cleanup prior to restart or shutdown. More... | |
status_t | log_open (const char *fname, boolean append, boolean tstamps) |
Open a logfile for writing. More... | |
void | log_close (void) |
Close the logfile. More... | |
status_t | log_audit_open (const char *fname, boolean append, boolean tstamps) |
Open the audit logfile for writing. More... | |
void | log_audit_close (void) |
Close the audit_logfile. More... | |
boolean | log_audit_is_open (void) |
Check if the audit log is open. More... | |
status_t | log_alt_open (const char *fname) |
Open an alternate logfile for writing. More... | |
status_t | log_alt_open_ex (const char *fname, boolean overwrite) |
Open an alternate logfile for writing. More... | |
status_t | log_alt_open_force (const char *fname, boolean overwrite, boolean force_mode) |
Open an alternate logfile for writing. More... | |
void | log_alt_close (void) |
Close the alternate logfile. More... | |
void | log_init (void) |
Initialize logger state. More... | |
void | log_flush (void) |
Flush output buffers. More... | |
void | log_stdout (const char *fstr,...) __attribute__((format(printf |
Write output to STDOUT. More... | |
void void | log_stdout_level (log_debug_t level, const char *fstr,...) __attribute__((format(printf |
Write output to STDOUT if debug level set. More... | |
void void void | log_write (const char *fstr,...) __attribute__((format(printf |
Write a new entry to the main log. More... | |
void void void void | log_write_append (const char *fstr,...) __attribute__((format(printf |
Append to the last log entry to the main log. More... | |
void void void void void void void void void | log_audit_write (const char *fstr,...) __attribute__((format(printf |
Write an new entry to the audit log file. More... | |
void void void void void void void void void void | log_audit_write_level (log_debug_t level, const char *fstr,...) __attribute__((format(printf |
Write an new entry to the audit log file if the log level is set. More... | |
void | log_alt_write (const char *fstr,...) __attribute__((format(printf |
Write to the alternate log file. More... | |
void void | log_alt_write_level (log_debug_t level, const char *fstr,...) __attribute__((format(printf |
Write to the alternate log file if debug-level set. More... | |
void | log_error (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_ERROR log entry. More... | |
void void | log_error_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_ERROR log entry. More... | |
void void void | log_warn (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_WARN log entry. More... | |
void void void void | log_warn_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_WARN log entry. More... | |
void void void void void | log_info (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_INFO log entry. More... | |
void void void void void void | log_info_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_INFO log entry. More... | |
void void void void void void void | log_debug (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_DEBUG log entry. More... | |
void void void void void void void void | log_debug_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_DEBUG log entry. More... | |
void void void void void void void void void | log_debug2 (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_DEBUG2 log entry. More... | |
void void void void void void void void void void | log_debug2_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_DEBUG2 log entry. More... | |
void void void void void void void void void void void | log_debug3 (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_DEBUG3 log entry. More... | |
void void void void void void void void void void void void | log_debug3_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_DEBUG3 log entry. More... | |
void void void void void void void void void void void void void | log_debug4 (const char *fstr,...) __attribute__((format(printf |
Generate a new LOG_DEBUG_DEBUG4 log entry. More... | |
void void void void void void void void void void void void void void | log_debug4_append (const char *fstr,...) __attribute__((format(printf |
Append to a LOG_DEBUG_DEBUG4 log entry. More... | |
void void void void void void void void void void void void void void void void void void void void logfn_t | log_get_logfn (log_debug_t loglevel) |
Get the logfn_t for the corresponding log-level. More... | |
logfn_t | log_get_appendfn (log_debug_t loglevel) |
Get the logfn_t for the corresponding log-level FOR APPEND. More... | |
void void void void void void void void void void void void | log_set_log_level (log_debug_t dlevel) |
Set the main log level. More... | |
void | log_set_syslog_log_level (log_debug_t dlevel) |
Set the syslog log level. More... | |
void | log_set_pthread_log_level (log_debug_t dlevel) |
Set the pthreads log level. More... | |
log_debug_t | log_get_log_level (void) |
Get the main log level. More... | |
log_debug_t | log_get_syslog_log_level (void) |
Get the syslog log level. More... | |
log_debug_t | log_get_pthread_log_level (void) |
Get the pthreads log level. More... | |
void | log_set_highres_datetime (boolean val) |
Set the high resolution date-time usage flag. More... | |
boolean | log_get_highres_datetime (void) |
Get the high resolution date-time usage flag. More... | |
Configure logging and write to the various logging streams.
The server can configure 3 different logging streams
The yangcli program uses the 'alt' log to save output to a temporary file.
void log_alt_close | ( | void | ) |
status_t log_alt_open | ( | const char * | fname | ) |
Open an alternate logfile for writing.
DO NOT use this function to send log entries to STDOUT Leave the logfile NULL instead.
fname | full filespec string for logfile |
status_t log_alt_open_ex | ( | const char * | fname, |
boolean | overwrite | ||
) |
Open an alternate logfile for writing.
DO NOT use this function to send log entries to STDOUT Leave the logfile NULL instead.
fname | full filespec string for logfile |
overwrite | TRUE if OK to overwrite; FALSE to generate DATA_EXISTS errors |
status_t log_alt_open_force | ( | const char * | fname, |
boolean | overwrite, | ||
boolean | force_mode | ||
) |
Open an alternate logfile for writing.
DO NOT use this function to send log entries to STDOUT Leave the logfile NULL instead.
This logfile will get a copy of the output if the force_mode parameter is true
fname | full filespec string for logfile |
overwrite | TRUE if OK to overwrite; FALSE to generate DATA_EXISTS errors |
force_mode | TRUE to check this log file from the log_vlog_common function FALSE to only check the altlogfile if a log_alt_write API is used. |
void log_alt_write | ( | const char * | fstr, |
... | |||
) |
Write to the alternate log file.
fstr | format string in printf format |
... | any additional arguments for fprintf |
void void log_alt_write_level | ( | log_debug_t | level, |
const char * | fstr, | ||
... | |||
) |
Write to the alternate log file if debug-level set.
level | debug level to check |
fstr | format string in printf format |
... | any additional arguments for fprintf |
void log_audit_close | ( | void | ) |
boolean log_audit_is_open | ( | void | ) |
Check if the audit log is open.
status_t log_audit_open | ( | const char * | fname, |
boolean | append, | ||
boolean | tstamps | ||
) |
Open the audit logfile for writing.
DO NOT use this function to send log entries to STDOUT Leave the audit_logfile NULL instead.
fname | full filespec string for audit logfile |
append | TRUE if the log should be appended; FALSE if it should be rewriten |
tstamps | TRUE if the datetime stamp should be generated at log-open and log-close time; FALSE if no open and close timestamps should be generated |
void void void void void void void void void log_audit_write | ( | const char * | fstr, |
... | |||
) |
Write an new entry to the audit log file.
Generate an audit log entry, regardless of log level
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void void log_audit_write_level | ( | log_debug_t | level, |
const char * | fstr, | ||
... | |||
) |
Write an new entry to the audit log file if the log level is set.
level | debug level to check |
fstr | format string in printf format |
... | any additional arguments for printf |
void log_cleanup | ( | boolean | phase2, |
boolean | debugs | ||
) |
Final logger cleanup prior to restart or shutdown.
void log_close | ( | void | ) |
Close the logfile.
void void void void void void void log_debug | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_DEBUG log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void log_debug2 | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_DEBUG2 log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void void log_debug2_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_DEBUG2 log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void void void log_debug3 | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_DEBUG3 log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void void void void log_debug3_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_DEBUG3 log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void void void void void log_debug4 | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_DEBUG4 log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void void void void void void void log_debug4_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_DEBUG4 log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void void void log_debug_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_DEBUG log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void log_error | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_ERROR log entry.
In general, call log_error() once and append additional output as many times as necessary to complete the message (for example, from a loop). Note that additional output at a different log level should NOT be attempted, but no check is made for this condition currently.
fstr | format string in printf format |
... | any additional arguments for printf |
void void log_error_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_ERROR log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void log_flush | ( | void | ) |
Flush output buffers.
NOTE: For "classic" output this is probably redundant since we clear buffers as we go along. However, for syslog and vendor streams this is important. That's because we buffer our formatted output and only send it on in full chunks. The buffering code can't always know when a buffered log message is complete.
logfn_t log_get_appendfn | ( | log_debug_t | loglevel | ) |
Get the logfn_t for the corresponding log-level FOR APPEND.
loglevel | log level enum to return default log function |
boolean log_get_highres_datetime | ( | void | ) |
Get the high resolution date-time usage flag.
log_debug_t log_get_log_level | ( | void | ) |
Get the main log level.
void void void void void void void void void void void void void void void void void void void void logfn_t log_get_logfn | ( | log_debug_t | loglevel | ) |
Get the logfn_t for the corresponding log-level.
loglevel | log level enum to return default log function |
log_debug_t log_get_pthread_log_level | ( | void | ) |
Get the pthreads log level.
log_debug_t log_get_syslog_log_level | ( | void | ) |
Get the syslog log level.
void void void void void log_info | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_INFO log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void void void log_info_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_INFO log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void log_init | ( | void | ) |
status_t log_open | ( | const char * | fname, |
boolean | append, | ||
boolean | tstamps | ||
) |
Open a logfile for writing.
DO NOT use this function to send log entries to STDOUT Leave the logfile NULL instead.
fname | full filespec string for logfile |
append | TRUE if the log should be appended; FALSE if it should be rewriten |
tstamps | TRUE if the datetime stamp should be generated at log-open and log-close time; FALSE if no open and close timestamps should be generated |
void log_set_highres_datetime | ( | boolean | val | ) |
Set the high resolution date-time usage flag.
If true then 'localtime' field will include a micro-seconds field. All 6 digits will be printed even if the value us less than 6 digits.
Implements –log-highres-datetime CLI parameter
val | value to use |
void void void void void void void void void void void void log_set_log_level | ( | log_debug_t | dlevel | ) |
Set the main log level.
dlevel | new main log debug level |
void log_set_pthread_log_level | ( | log_debug_t | dlevel | ) |
Set the pthreads log level.
dlevel | new pthreads log debug level |
void log_set_syslog_log_level | ( | log_debug_t | dlevel | ) |
Set the syslog log level.
dlevel | new syslog log debug level |
void log_stdout | ( | const char * | fstr, |
... | |||
) |
Write output to STDOUT.
Write lines of text to STDOUT, even if the logfile is open, unless the debug mode is set to NONE to indicate silent batch mode
fstr | format string in printf format @ param ... any additional arguments for printf |
void void log_stdout_level | ( | log_debug_t | level, |
const char * | fstr, | ||
... | |||
) |
Write output to STDOUT if debug level
set.
level | debug level threshold for printing output |
fstr | format string in printf format @ param ... any additional arguments for printf |
void void void log_warn | ( | const char * | fstr, |
... | |||
) |
Generate a new LOG_DEBUG_WARN log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void log_warn_append | ( | const char * | fstr, |
... | |||
) |
Append to a LOG_DEBUG_WARN log entry.
fstr | format string in printf format |
... | any additional arguments for printf |
void void void log_write | ( | const char * | fstr, |
... | |||
) |
Write a new entry to the main log.
Generate (append to) a log entry, regardless of log level (except batch mode).
fstr | format string in printf format |
... | any additional arguments for printf |
void void void void log_write_append | ( | const char * | fstr, |
... | |||
) |
Append to the last log entry to the main log.
fstr | format string in printf format |
... | any additional arguments for printf |