aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-01-20 17:04:23 +0100
committerHarald Welte <laforge@osmocom.org>2021-01-21 10:23:19 +0100
commit8d6ca6933f34972dd158de5db69d70c6ab6472f6 (patch)
tree64ed53c6599d3642736c58ce45a2e7530db9ac65
parent9c1e04e5802dfa25fcab3ca2c947897a1b7e7485 (diff)
logging_vty: Fix saving of "logging print file .. last"
Back in 2018 in I393907b3c9e0cc1145e102328adad0a83ee13a9f Neels introduced "last" as an optional flag to log the file/line number at the end of the line, rather than at the end of the header. It seems nobody has been usingi this feature, or at least never tried to save a related config file, as there was no code whatsoever that would ever save this optional "last" flag. Change-Id: I7b6245256aecc425722242aaabc154ac58ba27a0
-rw-r--r--src/vty/logging_vty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 02823504..6a7a8f44 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -1010,8 +1010,9 @@ static int config_write_log_single(struct vty *vty, struct log_target *tgt)
tgt->print_timestamp ? 1 : 0, VTY_NEWLINE);
if (tgt->print_level)
vty_out(vty, " logging print level 1%s", VTY_NEWLINE);
- vty_out(vty, " logging print file %s%s",
+ vty_out(vty, " logging print file %s%s%s",
get_value_string(logging_print_file_args, tgt->print_filename2),
+ tgt->print_filename_pos == LOG_FILENAME_POS_LINE_END ? " last" : "",
VTY_NEWLINE);
if (tgt->loglevel) {