diff options
author | Denis Vlasenko | 2006-09-06 18:36:50 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-09-06 18:36:50 +0000 |
commit | 3538b9a8822421b7c8596a33a917dcf2f99c92b7 (patch) | |
tree | 768c23fe79bb81583de7376a4d744632d888d303 /include | |
parent | 5d725462d44268f9a86030daaa6f6396d32f796c (diff) | |
download | busybox-3538b9a8822421b7c8596a33a917dcf2f99c92b7.zip busybox-3538b9a8822421b7c8596a33a917dcf2f99c92b7.tar.gz |
Implement optional syslog logging using ordinary
bb_xx_msg calls, and convert networking/* to it.
The rest of bbox will be converted gradually.
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 13 | ||||
-rw-r--r-- | include/usage.h | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h index 404ff2e..c6a9ae5 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -112,6 +112,14 @@ extern void *llist_pop(llist_t **elm); extern void llist_free(llist_t *elm, void (*freeit)(void *data)); +enum { + LOGMODE_NONE = 0, + LOGMODE_STDIO = 1<<0, + LOGMODE_SYSLOG = 1<<1, + LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO, +}; +extern int logmode; + extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE; extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); @@ -124,9 +132,12 @@ extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN; extern void bb_perror_nomsg(void); +extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); + /* These two are used internally -- you shouldn't need to use them */ -extern void bb_verror_msg(const char *s, va_list p) __attribute__ ((format (printf, 1, 0))); +extern void bb_verror_msg(const char *s, va_list p, const char *strerr) __attribute__ ((format (printf, 1, 0))); extern void bb_vperror_msg(const char *s, va_list p) __attribute__ ((format (printf, 1, 0))); +extern void bb_vinfo_msg(const char *s, va_list p) __attribute__ ((format (printf, 1, 0))); extern int bb_echo(int argc, char** argv); extern int bb_test(int argc, char** argv); diff --git a/include/usage.h b/include/usage.h index 0f56507..a1ba0a2 100644 --- a/include/usage.h +++ b/include/usage.h @@ -2092,7 +2092,7 @@ USE_FEATURE_MDEV_CONFIG( \ #define nameif_trivial_usage \ "[-s] [-c FILE] [{IFNAME MACADDR}]" #define nameif_full_usage \ - "Nameif renaming network interface while it in the down state.\n\n" \ + "Nameif renames network interface while it in the down state.\n\n" \ "Options:\n" \ "\t-c FILE\t\tUse configuration file (default is /etc/mactab)\n" \ "\t-s\t\tUse syslog (LOCAL0 facility)\n" \ |