diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-03-27 17:59:22 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-03-27 17:59:22 +0200 |
commit | b5e694267142042228a6cac99ecad6c4b4ef8759 (patch) | |
tree | 139b842ae9982dd14b649cf84346795c8cf5db8d /extras/volume_id/vol_id.c | |
parent | 727f3fb091cf4903e9e9aa21159f05c36aaede24 (diff) |
volume_id: provide a custom debug function
Diffstat (limited to 'extras/volume_id/vol_id.c')
-rw-r--r-- | extras/volume_id/vol_id.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c index 518962c10b..b086b3710c 100644 --- a/extras/volume_id/vol_id.c +++ b/extras/volume_id/vol_id.c @@ -60,6 +60,18 @@ void log_message(int priority, const char *format, ...) } #endif +static void vid_log(int priority, const char *file, int line, const char *format, ...) +{ +#ifdef USE_LOG + va_list args; + + va_start(args, format); + log_message(priority, format, args); + va_end(args); +#endif + return; +} + static void set_str(char *to, const char *from, size_t count) { size_t i, j, len; @@ -117,6 +129,9 @@ int main(int argc, char *argv[]) logging_init("vol_id"); + /* hook in our debug into libvolume_id */ + volume_id_log = vid_log; + for (i = 1 ; i < argc; i++) { char *arg = argv[i]; |