1/* This program is free software; you can redistribute it and/or modify
2 * it under the terms of the GNU General Public License as published by
3 * the Free Software Foundation; either version 2 of the License, or
4 * (at your option) any later version.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14 */
15
16#ifndef __ERR_H__
17#define __ERR_H__
18
19#define E_OFF		0
20#define E_FATAL         1
21#define E_ERROR		2
22#define E_WARN          3
23#define E_INFO          4
24#define E_DEBUG		5
25
26enum _log_facility
27{
28  L_GENERAL=0,
29  L_ARTWORK,
30  L_DB_SQL,
31  L_INOTIFY,
32  L_SCANNER,
33  L_METADATA,
34  L_HTTP,
35  L_SSDP,
36  L_TIVO,
37  L_MAX
38};
39
40extern int log_level[L_MAX];
41extern int log_init(const char *fname, const char *debug);
42extern void log_err(int level, enum _log_facility facility, char *fname, int lineno, char *fmt, ...);
43
44#define DPRINTF(level, facility, fmt, arg...) { log_err(level, facility, __FILE__, __LINE__, fmt, ##arg); }
45
46
47#endif /* __ERR_H__ */
48