layer23: Pre-rework of the Makefile.am
[osmocom-bb.git] / src / host / layer23 / src / logging.c
1 /* Logging/Debug support of the layer2/3 stack */
2
3 /* (C) 2010 by Harald Welte <laforge@gnumonks.org>
4  *
5  * All Rights Reserved
6  *
7  * This program 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.
11  *
12  * This program 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.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  */
22
23
24 #include <osmocore/utils.h>
25 #include <osmocore/logging.h>
26 #include <osmocom/logging.h>
27
28 static const struct log_info_cat default_categories[] = {
29         [DRSL] = {
30                 .name = "DRSL",
31                 .description = "Radio Signalling Link (MS)",
32                 .color = "\033[1;35m",
33                 .enabled = 1, .loglevel = LOGL_DEBUG,
34         },
35         [DCS] = {
36                 .name = "DCS",
37                 .description = "Cell selection",
38                 .color = "\033[34m",
39                 .enabled = 1, .loglevel = LOGL_DEBUG,
40         },
41         [DPLMN] = {
42                 .name = "DPLMN",
43                 .description = "PLMN selection",
44                 .color = "\033[32m",
45                 .enabled = 1, .loglevel = LOGL_DEBUG,
46         },
47         [DRR] = {
48                 .name = "DRR",
49                 .description = "Radio Resource",
50                 .color = "\033[1;34m",
51                 .enabled = 1, .loglevel = LOGL_DEBUG,
52         },
53         [DMM] = {
54                 .name = "DMM",
55                 .description = "Mobility Management",
56                 .color = "\033[1;32m",
57                 .enabled = 1, .loglevel = LOGL_DEBUG,
58         },
59         [DCC] = {
60                 .name = "DCC",
61                 .description = "Call Control",
62                 .color = "\033[1;33m",
63                 .enabled = 1, .loglevel = LOGL_DEBUG,
64         },
65         [DSMS] = {
66                 .name = "DSMS",
67                 .description = "Short Message Service",
68                 .color = "\033[1;37m",
69                 .enabled = 1, .loglevel = LOGL_DEBUG,
70         },
71         [DMNCC] = {
72                 .name = "DMNCC",
73                 .description = "Mobile Network Call Control",
74                 .color = "\033[1;37m",
75                 .enabled = 1, .loglevel = LOGL_DEBUG,
76         },
77         [DMEAS] = {
78                 .name = "DMEAS",
79                 .description = "MEasurement Reporting",
80                 .enabled = 1, .loglevel = LOGL_DEBUG,
81         },
82         [DPAG] = {
83                 .name = "DPAG",
84                 .description = "Paging",
85                 .color = "\033[33m",
86                 .enabled = 1, .loglevel = LOGL_DEBUG,
87         },
88         [DLAPDM] = {
89                 .name = "DLAPDM",
90                 .description = "LAPDm Layer2",
91                 .enabled = 1, .loglevel = LOGL_DEBUG,
92         },
93         [DL1C]  = {
94                 .name = "DL1C",
95                 .description = "Layer 1 Control",
96                 .color = "\033[1;31m",
97                 .enabled = 1, .loglevel = LOGL_DEBUG,
98         },
99         [DSUM] = {
100                 .name = "DSUM",
101                 .description = "Summary of Process",
102                 .color = "\033[1;37m",
103                 .enabled = 1, .loglevel = LOGL_DEBUG,
104         },
105 };
106
107 const struct log_info log_info = {
108         .filter_fn = NULL,
109         .cat = default_categories,
110         .num_cat = ARRAY_SIZE(default_categories),
111 };
112