This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgHello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/5813
to look at the new patch set (#2).
logging: vty: add 'logging print file (0|1|with-cat)' cmd
Add a VTY command that allows configuring the output of source filename. So
far, this was not configurable by VTY at all.
Accomodate the (what I see as) legacy behavior of including the log category in
hex form as argument 'with-cat'. 0 disables file output, 1 enables only file
output without the hex category.
The default behavior on startup still is to log file and hex category, to stay
backwards compatible.
Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc
---
M src/vty/logging_vty.c
1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/5813/2
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index fd76d04..bccc278 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -237,6 +237,23 @@
return CMD_SUCCESS;
}
+DEFUN(logging_prnt_file,
+ logging_prnt_file_cmd,
+ "logging print file (0|1)",
+ LOGGING_STR "Log output settings\n"
+ "Configure log message\n"
+ "Don't prefix each log message\n"
+ "Prefix each log message with the source file and line\n")
+{
+ struct log_target *tgt = osmo_log_vty2tgt(vty);
+
+ if (!tgt)
+ return CMD_WARNING;
+
+ log_set_print_filename(tgt, atoi(argv[0]));
+ return CMD_SUCCESS;
+}
+
DEFUN(logging_level,
logging_level_cmd,
NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */
@@ -770,6 +787,8 @@
tgt->print_timestamp ? 1 : 0, VTY_NEWLINE);
if (tgt->print_level)
vty_out(vty, " logging print level 1%s", VTY_NEWLINE);
+ if (tgt->print_filename)
+ vty_out(vty, " logging print file 1%s", VTY_NEWLINE);
/* stupid old osmo logging API uses uppercase strings... */
osmo_str2lower(level_lower, log_level_str(tgt->loglevel));
@@ -821,6 +840,7 @@
install_element_ve(&logging_prnt_cat_cmd);
install_element_ve(&logging_prnt_cat_hex_cmd);
install_element_ve(&logging_prnt_level_cmd);
+ install_element_ve(&logging_prnt_file_cmd);
install_element_ve(&logging_set_category_mask_cmd);
install_element_ve(&logging_set_category_mask_old_cmd);
@@ -839,6 +859,7 @@
install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd);
install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd);
install_element(CFG_LOG_NODE, &logging_prnt_level_cmd);
+ install_element(CFG_LOG_NODE, &logging_prnt_file_cmd);
install_element(CFG_LOG_NODE, &logging_level_cmd);
install_element(CONFIG_NODE, &cfg_log_stderr_cmd);
--
To view, visit https://gerrit.osmocom.org/5813
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder