From b8c1f1cf062ff681daf160411ad6c35ed7a49d42 Mon Sep 17 00:00:00 2001 From: GDR! Date: Mon, 22 Dec 2014 03:22:38 +0100 Subject: Logging framework and command line options --- util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index b523236..4b7aa26 100644 --- a/util.c +++ b/util.c @@ -1,3 +1,4 @@ +#include "log.h" #include "util.h" #include #include @@ -134,7 +135,7 @@ void* file_raw(char *path, uint32_t *size) file = fopen(path, "rb"); if(!file) { - fprintf(stderr, "File not found (%s)\n", path); + log_printf(L_WARNING, "File not found (%s)\n", path); return NULL; } @@ -149,7 +150,7 @@ void* file_raw(char *path, uint32_t *size) fseek(file, 0, SEEK_SET); if(fread(data, len, 1, file) != 1) { - fprintf(stderr, "Read error (%s)\n", path); + log_printf(L_WARNING, "Read error (%s)\n", path); fclose(file); free(data); return NULL; @@ -157,7 +158,7 @@ void* file_raw(char *path, uint32_t *size) fclose(file); - fprintf(stderr, "Read %u bytes (%s)\n", len, path); + log_printf(L_DEBUG, "Read %u bytes (%s)\n", len, path); if(size) { *size = len; -- cgit v1.2.3