Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 1 | /* simple test for the debug interface */ |
| 2 | /* |
Holger Hans Peter Freyther | a22e085 | 2009-12-23 05:08:12 +0100 | [diff] [blame] | 3 | * (C) 2008, 2009 by Holger Hans Peter Freyther <zecke@selfish.org> |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 4 | * All Rights Reserved |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
Harald Welte | 0e3e88e | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 7 | * it under the terms of the GNU Affero General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 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 | * |
Harald Welte | 0e3e88e | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 16 | * You should have received a copy of the GNU Affero General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <openbsc/debug.h> |
| 22 | |
| 23 | |
Holger Hans Peter Freyther | dfd61a3 | 2010-09-18 06:44:24 +0800 | [diff] [blame] | 24 | int main(int argc, char **argv) |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 25 | { |
Harald Welte | 51d2a59 | 2010-03-26 21:28:59 +0800 | [diff] [blame] | 26 | struct log_target *stderr_target; |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 27 | |
Harald Welte | 280413b | 2011-06-27 14:23:40 +0200 | [diff] [blame^] | 28 | log_init(&log_info, NULL); |
Harald Welte | 51d2a59 | 2010-03-26 21:28:59 +0800 | [diff] [blame] | 29 | stderr_target = log_target_create_stderr(); |
| 30 | log_add_target(stderr_target); |
| 31 | log_set_all_filter(stderr_target, 1); |
Holger Hans Peter Freyther | a22e085 | 2009-12-23 05:08:12 +0100 | [diff] [blame] | 32 | |
Harald Welte | 51d2a59 | 2010-03-26 21:28:59 +0800 | [diff] [blame] | 33 | log_parse_category_mask(stderr_target, "DRLL"); |
Holger Hans Peter Freyther | a22e085 | 2009-12-23 05:08:12 +0100 | [diff] [blame] | 34 | DEBUGP(DCC, "You should not see this\n"); |
| 35 | |
Harald Welte | 51d2a59 | 2010-03-26 21:28:59 +0800 | [diff] [blame] | 36 | log_parse_category_mask(stderr_target, "DRLL:DCC"); |
Holger Hans Peter Freyther | a22e085 | 2009-12-23 05:08:12 +0100 | [diff] [blame] | 37 | DEBUGP(DRLL, "You should see this\n"); |
| 38 | DEBUGP(DCC, "You should see this\n"); |
| 39 | DEBUGP(DMM, "You should not see this\n"); |
Holger Hans Peter Freyther | b010f2a | 2010-04-07 23:00:23 +0200 | [diff] [blame] | 40 | |
| 41 | return 0; |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 42 | } |