1/* MiniDLNA media server
2 * Copyright (C) 2008-2010 NETGEAR, Inc. All Rights Reserved.
3 *
4 * This file is part of MiniDLNA.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef __ERR_H__
22#define __ERR_H__
23
24#define E_OFF       0
25#define E_FATAL     1
26#define E_ERROR     2
27#define E_WARN      3
28#define E_INFO      4
29#define E_DEBUG     5
30#define E_MAXDEBUG  6
31
32enum _log_facility
33{
34  L_GENERAL=0,
35  L_ARTWORK,
36  L_DB_SQL,
37  L_INOTIFY,
38  L_SCANNER,
39  L_METADATA,
40  L_HTTP,
41  L_SSDP,
42  L_TIVO,
43  L_MAX
44};
45
46extern int log_level[L_MAX];
47extern int log_init(const char *fname, const char *debug);
48extern void log_close(void);
49extern void log_err(int level, enum _log_facility facility, char *fname, int lineno, char *fmt, ...)
50	__attribute__((__format__ (__printf__, 5, 6)));
51
52//#define DPRINTF(level, facility, fmt, arg...) do { log_err(level, facility, __FILE__, __LINE__, fmt, ##arg); } while (0)
53#define DPRINTF(level, facility, fmt, arg...)
54
55#endif /* __ERR_H__ */
56