Export flog() function and define new log macros ERR(), WARN(), etc.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
90fb520c06
commit
53c2d0e3d9
@ -159,7 +159,6 @@ void wallmsg(struct filed *f, struct iovec *iov, int iovcnt);
|
||||
void reapchild();
|
||||
const char *cvtaddr(struct sockaddr_storage *f, int len);
|
||||
const char *cvthname(struct sockaddr_storage *f, int len);
|
||||
static void flog(int pri, char *fmt, ...);
|
||||
void domark();
|
||||
void debug_switch();
|
||||
void logerror(const char *type);
|
||||
@ -2008,7 +2007,7 @@ const char *cvthname(struct sockaddr_storage *f, int len)
|
||||
/*
|
||||
* Base function for domark(), logerror(), etc.
|
||||
*/
|
||||
static void flog(int pri, char *fmt, ...)
|
||||
void flog(int pri, char *fmt, ...)
|
||||
{
|
||||
struct buf_msg buffer;
|
||||
va_list ap;
|
||||
|
@ -112,6 +112,13 @@
|
||||
#define NELEMS(array) (sizeof(array) / sizeof(array[0]))
|
||||
#endif
|
||||
|
||||
/* Helper internal log macros */
|
||||
#define ERR(fmt, args...) flog(LOG_SYSLOG | LOG_ERR, fmt ": %m", ##args)
|
||||
#define ERRX(fmt, args...) flog(LOG_SYSLOG | LOG_ERR, fmt, ##args)
|
||||
#define WARN(fmt, args...) flog(LOG_SYSLOG | LOG_WARN, fmt, ##args)
|
||||
#define NOTE(fmt, args...) flog(LOG_SYSLOG | LOG_NOTICE, fmt, ##args)
|
||||
#define INFO(fmt, args...) flog(LOG_SYSLOG | LOG_INFO, fmt, ##args)
|
||||
|
||||
/*
|
||||
* Flags to logmsg().
|
||||
*/
|
||||
@ -215,4 +222,6 @@ struct filed {
|
||||
int f_rotatesz;
|
||||
};
|
||||
|
||||
void flog(int pri, char *fmt, ...);
|
||||
|
||||
#endif /* SYSKLOGD_SYSLOGD_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user