X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=include%2Flog.h;h=d154ba7c709651353b30e0d1110094decd18aa1e;hb=cbd27635e12481b9f3eef2167ec62d111fdb4b70;hp=bf0dab50b909ef0b0f9d693787a53944f2c8d91d;hpb=46a64b472133cce416bd49e00a2cd3c7a2bd7c53;p=connman diff --git a/include/log.h b/include/log.h index bf0dab5..d154ba7 100644 --- a/include/log.h +++ b/include/log.h @@ -2,7 +2,7 @@ * * Connection Manager * - * Copyright (C) 2007 Intel Corporation. All rights reserved. + * Copyright (C) 2007-2009 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -26,11 +26,28 @@ extern "C" { #endif -#define DBG(fmt, arg...) connman_debug("%s: " fmt, __FUNCTION__ , ## arg) +/** + * SECTION:log + * @title: Logging premitives + * @short_description: Functions for logging error and debug information + */ + +extern void connman_info(const char *format, ...) + __attribute__((format(printf, 1, 2))); +extern void connman_error(const char *format, ...) + __attribute__((format(printf, 1, 2))); +extern void connman_debug(const char *format, ...) + __attribute__((format(printf, 1, 2))); -extern void connman_info(const char *format, ...); -extern void connman_error(const char *format, ...); -extern void connman_debug(const char *format, ...); +/** + * DBG: + * @fmt: format string + * @arg...: list of arguments + * + * Simple macro around connman_debug() which also include the function + * name it is called in. + */ +#define DBG(fmt, arg...) connman_debug("%s:%s() " fmt, __FILE__, __FUNCTION__ , ## arg) #ifdef __cplusplus }