diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-03-09 19:30:07 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-03-09 19:30:07 +0000 |
commit | cc31145e63f9c87e816267e69e73d74e669563a1 (patch) | |
tree | 07a70b1ceef2ce36bf7c29d23f95137cc2ceae09 /hcid | |
parent | b945f54411dfde6992f65233e2974b1a1b5b87d3 (diff) |
Add general logging functions
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/hcid.h | 5 | ||||
-rw-r--r-- | hcid/logging.c | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/hcid/hcid.h b/hcid/hcid.h index c6516f9f..8d84af92 100644 --- a/hcid/hcid.h +++ b/hcid/hcid.h @@ -24,6 +24,7 @@ */ #include <time.h> +#include <stdarg.h> #include <syslog.h> #include <sys/types.h> #include <sys/ioctl.h> @@ -173,6 +174,10 @@ int read_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key); int read_pin_length(bdaddr_t *local, bdaddr_t *peer); int read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin); +void info(const char *format, va_list ap); +void error(const char *format, va_list ap); +void debug(const char *format, va_list ap); + static inline int find_conn(int dd, int dev_id, long arg) { struct hci_conn_list_req *cl; diff --git a/hcid/logging.c b/hcid/logging.c index f3bf47c4..9d0ff214 100644 --- a/hcid/logging.c +++ b/hcid/logging.c @@ -27,3 +27,22 @@ #include <stdio.h> #include <errno.h> +#include <stdarg.h> +#include <syslog.h> + +#include "hcid.h" + +void info(const char *format, va_list ap) +{ + vsyslog(LOG_INFO, format, ap); +} + +void error(const char *format, va_list ap) +{ + vsyslog(LOG_ERR, format, ap); +} + +void debug(const char *format, va_list ap) +{ + vsyslog(LOG_DEBUG, format, ap); +} |