blob: cc5be44d4af59f2193bc1d13674e2b3f9c1dc69a [file] [log] [blame]
Pau Espin Pedrol21d03d32019-07-22 12:05:52 +02001/*
2 * Copyright (C) 2018-2019 sysmocom - s.f.m.c. GmbH
3 * All Rights Reserved
4 *
5 * SPDX-License-Identifier: AGPL-3.0+
6 *
7 * Author: Pau Espin Pedrol <pespin@sysmocom.de>
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
18 *
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * See the COPYING file in the main directory for details.
22 */
23
Pau Espin Pedrolc9202ab2019-07-01 20:13:32 +020024#include <pthread.h>
25
Pau Espin Pedrol5ea18172018-02-20 16:48:15 +010026#include <osmocom/core/logging.h>
27#include <osmocom/core/utils.h>
28#include "debug.h"
29
30/* default categories */
31static const struct log_info_cat default_categories[] = {
32 [DMAIN] = {
33 .name = "DMAIN",
34 .description = "Main generic category",
35 .color = NULL,
36 .enabled = 1, .loglevel = LOGL_NOTICE,
37 },
Pau Espin Pedrol9f2baf32019-12-19 21:03:03 +010038 [DTRXCLK] = {
39 .name = "DTRXCLK",
40 .description = "TRX Master Clock",
41 .color = NULL,
42 .enabled = 1, .loglevel = LOGL_NOTICE,
43 },
Pau Espin Pedrol441d82a2018-12-04 16:37:24 +010044 [DTRXCTRL] = {
45 .name = "DTRXCTRL",
46 .description = "TRX CTRL interface",
47 .color = "\033[1;33m",
48 .enabled = 1, .loglevel = LOGL_NOTICE,
49 },
Pau Espin Pedrol9f2baf32019-12-19 21:03:03 +010050 [DTRXDDL] = {
51 .name = "DTRXDDL",
52 .description = "TRX Data interface Downlink",
53 .color = NULL,
54 .enabled = 1, .loglevel = LOGL_NOTICE,
55 },
56 [DTRXDUL] = {
57 .name = "DTRXDUL",
58 .description = "TRX CTRL interface Uplink",
59 .color = NULL,
60 .enabled = 1, .loglevel = LOGL_NOTICE,
61 },
Harald Welte5cc88582018-08-17 19:55:38 +020062 [DDEV] = {
63 .name = "DDEV",
64 .description = "Device/Driver specific code",
65 .color = NULL,
66 .enabled = 1, .loglevel = LOGL_INFO,
67 },
Pau Espin Pedrolc7a0bf12018-04-25 12:17:10 +020068 [DLMS] = {
69 .name = "DLMS",
Harald Welte5cc88582018-08-17 19:55:38 +020070 .description = "Logging from within LimeSuite itself",
Pau Espin Pedrolc7a0bf12018-04-25 12:17:10 +020071 .color = NULL,
72 .enabled = 1, .loglevel = LOGL_NOTICE,
73 },
Pau Espin Pedrol5ea18172018-02-20 16:48:15 +010074};
75
76const struct log_info log_info = {
77 .cat = default_categories,
78 .num_cat = ARRAY_SIZE(default_categories),
79};