2 * libdpkg - Debian packaging suite library routines
3 * debug.h - debugging support
5 * Copyright © 2011 Guillem Jover <guillem@debian.org>
7 * This is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 #ifndef LIBDPKG_DEBUG_H
22 #define LIBDPKG_DEBUG_H
24 #include <dpkg/macros.h>
32 * @defgroup debug Debugging
33 * @ingroup dpkg-internal
38 * XXX: We do not use DPKG_BIT() here, because the octal values are part
39 * of the current output interface.
41 enum DPKG_ATTR_ENUM_FLAGS debugflags
{
45 dbg_eachfiledetail
= 0100,
47 dbg_conffdetail
= 0200,
49 dbg_depcondetail
= 0400,
50 dbg_veryverbose
= 01000,
51 dbg_stupidlyverbose
= 02000,
52 dbg_triggers
= 010000,
53 dbg_triggersdetail
= 020000,
54 dbg_triggersstupid
= 040000,
57 void dpkg_debug_init(void);
58 void debug_set_output(FILE *output
, const char *filename
);
59 void debug_set_mask(int mask
);
60 int debug_parse_mask(const char *str
);
61 bool debug_has_flag(int flag
);
62 void debug(int flag
, const char *fmt
, ...) DPKG_ATTR_PRINTF(2);
68 #endif /* LIBDPKG_DEBUG_H */