diff options
author | Kay Sievers <kay@vrfy.org> | 2012-04-08 16:06:20 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-04-08 16:06:20 +0200 |
commit | baa30fbc2c04b23209d0b8fb3c86cd15ef9ea81a (patch) | |
tree | 5a98ddb8cdebeb608526a708dbd5fcc307840a84 /src/udev/libudev-private.h | |
parent | 64661ee70d5a10c6208a1cb66ecd8b158e2d8bc5 (diff) |
udev: switch to systemd logging functions
Diffstat (limited to 'src/udev/libudev-private.h')
-rw-r--r-- | src/udev/libudev-private.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/udev/libudev-private.h b/src/udev/libudev-private.h index df11e3743c..d914aa4599 100644 --- a/src/udev/libudev-private.h +++ b/src/udev/libudev-private.h @@ -1,7 +1,7 @@ /* * libudev - interface to udev device information * - * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org> + * Copyright (C) 2008-2012 Kay Sievers <kay.sievers@vrfy.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,36 +20,20 @@ #include "libudev.h" #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#define READ_END 0 -#define WRITE_END 1 - -static inline void __attribute__((always_inline, format(printf, 2, 3))) -udev_log_null(struct udev *udev, const char *format, ...) {} +#define READ_END 0 +#define WRITE_END 1 +/* avoid (sometimes expensive) calculations of parameters for debug output */ #define udev_log_cond(udev, prio, arg...) \ do { \ if (udev_get_log_priority(udev) >= prio) \ udev_log(udev, prio, __FILE__, __LINE__, __FUNCTION__, ## arg); \ } while (0) -#ifdef ENABLE_DEBUG -# define dbg(udev, arg...) udev_log_cond(udev, LOG_DEBUG, ## arg) -#else -# define dbg(udev, arg...) udev_log_null(udev, ## arg) -#endif +#define dbg(udev, arg...) udev_log_cond(udev, LOG_DEBUG, ## arg) #define info(udev, arg...) udev_log_cond(udev, LOG_INFO, ## arg) #define err(udev, arg...) udev_log_cond(udev, LOG_ERR, ## arg) -static inline void udev_log_init(const char *program_name) -{ - openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON); -} - -static inline void udev_log_close(void) -{ - closelog(); -} - /* libudev.c */ void udev_log(struct udev *udev, int priority, const char *file, int line, const char *fn, |