aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty
diff options
context:
space:
mode:
authorEric <ewild@sysmocom.de>2022-12-15 14:51:40 +0100
committerHoernchen <ewild@sysmocom.de>2024-01-09 15:28:29 +0000
commit7dc6d4a629a37bb081d62f6ce61f4e5ee0237247 (patch)
tree38b2653ad9c101ce2c7e4efa303bb5b22ab6f87b /src/vty
parent85554db38d45c3f2e72b5b9c37a5c1c7b9ecc009 (diff)
logging: add log level cache
This ensures multithreaded logging attempts, in particular ones that do nothing, do not hold the lock just for checking the level, which interferes with other logging attempts. Closes: OS#5818 Change-Id: I35f8dd9127dd6e7feae392094fd6b3ce2d32558d
Diffstat (limited to 'src/vty')
-rw-r--r--src/vty/logging_vty.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 2a074222..678ae686 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -382,6 +382,10 @@ DEFUN(logging_level,
tgt->categories[category].enabled = 1;
tgt->categories[category].loglevel = level;
+#if !defined(EMBEDDED)
+ log_cache_update(category, 1, level);
+#endif
+
RET_WITH_UNLOCK(CMD_SUCCESS);
}
@@ -406,6 +410,9 @@ DEFUN(logging_level_set_all, logging_level_set_all_cmd,
cat->enabled = 1;
cat->loglevel = level;
+#if !defined(EMBEDDED)
+ log_cache_update(i, 1, level);
+#endif
}
RET_WITH_UNLOCK(CMD_SUCCESS);
}