"Fossies" - the Fresh Open Source Software Archive

Member "minidlna-1.3.0/log.h" (24 Nov 2020, 1609 Bytes) of package /linux/privat/minidlna-1.3.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "log.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.2.1_vs_1.3.0.

    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 
   32 enum _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 
   46 extern int log_level[L_MAX];
   47 extern int log_init(const char *debug);
   48 extern void log_close(void);
   49 extern void log_reopen(void);
   50 extern void log_err(int level, enum _log_facility facility, char *fname, int lineno, char *fmt, ...)
   51     __attribute__((__format__ (__printf__, 5, 6)));
   52 
   53 #define DPRINTF(level, facility, fmt, arg...) do { log_err(level, facility, __FILE__, __LINE__, fmt, ##arg); } while (0)
   54 
   55 
   56 #endif /* __ERR_H__ */