Pau Espin Pedrol | 21d03d3 | 2019-07-22 12:05:52 +0200 | [diff] [blame] | 1 | /* |
| 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 Pedrol | c9202ab | 2019-07-01 20:13:32 +0200 | [diff] [blame] | 24 | #include <pthread.h> |
| 25 | |
Pau Espin Pedrol | 5ea1817 | 2018-02-20 16:48:15 +0100 | [diff] [blame] | 26 | #include <osmocom/core/logging.h> |
| 27 | #include <osmocom/core/utils.h> |
| 28 | #include "debug.h" |
| 29 | |
| 30 | /* default categories */ |
| 31 | static 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 Pedrol | 9f2baf3 | 2019-12-19 21:03:03 +0100 | [diff] [blame] | 38 | [DTRXCLK] = { |
| 39 | .name = "DTRXCLK", |
| 40 | .description = "TRX Master Clock", |
| 41 | .color = NULL, |
| 42 | .enabled = 1, .loglevel = LOGL_NOTICE, |
| 43 | }, |
Pau Espin Pedrol | 441d82a | 2018-12-04 16:37:24 +0100 | [diff] [blame] | 44 | [DTRXCTRL] = { |
| 45 | .name = "DTRXCTRL", |
| 46 | .description = "TRX CTRL interface", |
| 47 | .color = "\033[1;33m", |
| 48 | .enabled = 1, .loglevel = LOGL_NOTICE, |
| 49 | }, |
Pau Espin Pedrol | 9f2baf3 | 2019-12-19 21:03:03 +0100 | [diff] [blame] | 50 | [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 Welte | 5cc8858 | 2018-08-17 19:55:38 +0200 | [diff] [blame] | 62 | [DDEV] = { |
| 63 | .name = "DDEV", |
| 64 | .description = "Device/Driver specific code", |
| 65 | .color = NULL, |
| 66 | .enabled = 1, .loglevel = LOGL_INFO, |
| 67 | }, |
Pau Espin Pedrol | c7a0bf1 | 2018-04-25 12:17:10 +0200 | [diff] [blame] | 68 | [DLMS] = { |
| 69 | .name = "DLMS", |
Harald Welte | 5cc8858 | 2018-08-17 19:55:38 +0200 | [diff] [blame] | 70 | .description = "Logging from within LimeSuite itself", |
Pau Espin Pedrol | c7a0bf1 | 2018-04-25 12:17:10 +0200 | [diff] [blame] | 71 | .color = NULL, |
| 72 | .enabled = 1, .loglevel = LOGL_NOTICE, |
| 73 | }, |
Pau Espin Pedrol | 5ea1817 | 2018-02-20 16:48:15 +0100 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | const struct log_info log_info = { |
| 77 | .cat = default_categories, |
| 78 | .num_cat = ARRAY_SIZE(default_categories), |
| 79 | }; |