blob: 5767eddb5f220f0562ca46334ebac7ca8d4cceef [file] [log] [blame]
Holger Freytherd546e312008-12-27 12:03:07 +00001/* simple test for the debug interface */
2/*
Holger Hans Peter Freytherf9b1f302009-12-23 05:08:12 +01003 * (C) 2008, 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
Holger Freytherd546e312008-12-27 12:03:07 +00004 * All Rights Reserved
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
22#include <openbsc/debug.h>
23
24
Holger Hans Peter Freytheradb6e1c2010-09-18 06:44:24 +080025int main(int argc, char **argv)
Holger Freytherd546e312008-12-27 12:03:07 +000026{
Harald Weltedc5062b2010-03-26 21:28:59 +080027 struct log_target *stderr_target;
Holger Freytherd546e312008-12-27 12:03:07 +000028
Harald Weltedc5062b2010-03-26 21:28:59 +080029 log_init(&log_info);
30 stderr_target = log_target_create_stderr();
31 log_add_target(stderr_target);
32 log_set_all_filter(stderr_target, 1);
Holger Hans Peter Freytherf9b1f302009-12-23 05:08:12 +010033
Harald Weltedc5062b2010-03-26 21:28:59 +080034 log_parse_category_mask(stderr_target, "DRLL");
Holger Hans Peter Freytherf9b1f302009-12-23 05:08:12 +010035 DEBUGP(DCC, "You should not see this\n");
36
Harald Weltedc5062b2010-03-26 21:28:59 +080037 log_parse_category_mask(stderr_target, "DRLL:DCC");
Holger Hans Peter Freytherf9b1f302009-12-23 05:08:12 +010038 DEBUGP(DRLL, "You should see this\n");
39 DEBUGP(DCC, "You should see this\n");
40 DEBUGP(DMM, "You should not see this\n");
Holger Hans Peter Freyther500ff972010-04-07 23:00:23 +020041
42 return 0;
Holger Freytherd546e312008-12-27 12:03:07 +000043}