summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-11-20 04:00:29 +0100
committerlaforge <laforge@osmocom.org>2019-11-23 07:58:47 +0000
commitf2644aee5525a6f889816c3e0d613e3c7145d01d (patch)
treed940f9955612690ad3be2e805d5b8ddf08b45223 /tests
parenta981f9dfd4e9305b627e552aeecdabe8a4ca486a (diff)
logging.h: define ansi color constants
It's hard to figure out what color logging categories have with those ANSI color code strings. Instead, define these OSMO_LOGCOLOR_* constants. Naming: commonly, the logging.h header has the "LOG" prefix in the name, but it seems saner to include the OSMO_ prefix: it seems too likely that some libosmocore user somewhere already has defined "LOGCOLOR_RED" somewhere. Change-Id: I03b6b1f73ae7ee61d37ff921e071a3d0881d3e9a
Diffstat (limited to 'tests')
-rw-r--r--tests/logging/logging_test.c6
-rw-r--r--tests/loggingrb/loggingrb_test.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/logging/logging_test.c b/tests/logging/logging_test.c
index 8fd71d0c..b9cb57fb 100644
--- a/tests/logging/logging_test.c
+++ b/tests/logging/logging_test.c
@@ -37,19 +37,19 @@ static const struct log_info_cat default_categories[] = {
[DRLL] = {
.name = "DRLL",
.description = "A-bis Radio Link Layer (RLL)",
- .color = "\033[1;31m",
+ .color = OSMO_LOGCOLOR_RED,
.enabled = 1, .loglevel = LOGL_NOTICE,
},
[DCC] = {
.name = "DCC",
.description = "Layer3 Call Control (CC)",
- .color = "\033[1;32m",
+ .color = OSMO_LOGCOLOR_GREEN,
.enabled = 1, .loglevel = LOGL_NOTICE,
},
[DMM] = {
.name = NULL,
.description = "Layer3 Mobility Management (MM)",
- .color = "\033[1;33m",
+ .color = OSMO_LOGCOLOR_YELLOW,
.enabled = 1, .loglevel = LOGL_NOTICE,
},
};
diff --git a/tests/loggingrb/loggingrb_test.c b/tests/loggingrb/loggingrb_test.c
index 3372c0c3..0b2ae5b5 100644
--- a/tests/loggingrb/loggingrb_test.c
+++ b/tests/loggingrb/loggingrb_test.c
@@ -34,19 +34,19 @@ static const struct log_info_cat default_categories[] = {
[DRLL] = {
.name = "DRLL",
.description = "A-bis Radio Link Layer (RLL)",
- .color = "\033[1;31m",
+ .color = OSMO_LOGCOLOR_RED,
.enabled = 1, .loglevel = LOGL_NOTICE,
},
[DCC] = {
.name = "DCC",
.description = "Layer3 Call Control (CC)",
- .color = "\033[1;32m",
+ .color = OSMO_LOGCOLOR_GREEN,
.enabled = 1, .loglevel = LOGL_NOTICE,
},
[DMM] = {
.name = NULL,
.description = "Layer3 Mobility Management (MM)",
- .color = "\033[1;33m",
+ .color = OSMO_LOGCOLOR_BLUE,
.enabled = 1, .loglevel = LOGL_NOTICE,
},
};