X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Flogger.h;h=45e8b594db80d00faeabda48f60fa821afa97ec5;hb=fda63ad40b874933e2342a1f2f3d6f4b642d12ff;hp=ba8b95f58e2a884934f23c08c7cea2f85aa5628a;hpb=1b4a582b04fc39d9d4d930acb4d0803bdedfb32e;p=deb_shairplay.git diff --git a/src/lib/logger.h b/src/lib/logger.h index ba8b95f..45e8b59 100644 --- a/src/lib/logger.h +++ b/src/lib/logger.h @@ -1,3 +1,17 @@ +/** + * Copyright (C) 2011-2012 Juho Vähä-Herttua + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + #ifndef LOGGER_H #define LOGGER_H @@ -11,15 +25,13 @@ #define LOGGER_INFO 6 /* informational */ #define LOGGER_DEBUG 7 /* debug-level messages */ -typedef void (*logger_callback_t)(int level, char *msg); +typedef void (*logger_callback_t)(int level, const char *msg); -struct logger_s { - int level; - logger_callback_t callback; -}; typedef struct logger_s logger_t; -void logger_init(logger_t *logger); +logger_t *logger_init(); +void logger_destroy(logger_t *logger); + void logger_set_level(logger_t *logger, int level); void logger_set_callback(logger_t *logger, logger_callback_t callback);