~awe/phablet-extras/ofono-nettime-plugin

« back to all changes in this revision

Viewing changes to include/log.h

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2009-08-15 15:55:11 UTC
  • Revision ID: james.westby@ubuntu.com-20090815155511-frst06dijguhyfi4
Tags: upstream-0.3
ImportĀ upstreamĀ versionĀ 0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  oFono - Open Telephony stack for Linux
 
4
 *
 
5
 *  Copyright (C) 2008-2009  Intel Corporation. All rights reserved.
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License version 2 as
 
9
 *  published by the Free Software Foundation.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 *
 
20
 */
 
21
 
 
22
#ifndef __OFONO_LOG_H
 
23
#define __OFONO_LOG_H
 
24
 
 
25
#ifdef __cplusplus
 
26
extern "C" {
 
27
#endif
 
28
 
 
29
/**
 
30
 * SECTION:log
 
31
 * @title: Logging premitives
 
32
 * @short_description: Functions for logging error and debug information
 
33
 */
 
34
 
 
35
extern void ofono_info(const char *format, ...)
 
36
                                __attribute__((format(printf, 1, 2)));
 
37
extern void ofono_warn(const char *format, ...)
 
38
                                __attribute__((format(printf, 1, 2)));
 
39
extern void ofono_error(const char *format, ...)
 
40
                                __attribute__((format(printf, 1, 2)));
 
41
extern void ofono_debug(const char *format, ...)
 
42
                                __attribute__((format(printf, 1, 2)));
 
43
 
 
44
/**
 
45
 * DBG:
 
46
 * @fmt: format string
 
47
 * @arg...: list of arguments
 
48
 *
 
49
 * Simple macro around ofono_debug() which also include the function
 
50
 * name it is called in.
 
51
 */
 
52
#define DBG(fmt, arg...) ofono_debug("%s:%s() " fmt, __FILE__, __FUNCTION__ , ## arg)
 
53
 
 
54
#ifdef __cplusplus
 
55
}
 
56
#endif
 
57
 
 
58
#endif /* __OFONO_LOG_H */