[MERGED] libosmocore[master]: Ignore broken everything log level

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jul 10 15:26:18 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Ignore broken everything log level
......................................................................


Ignore broken everything log level

* when reading config file (or vty command) ignore "logging level
  .. everything" level
* when writing config file, skip "logging level .. everything" level

In both cases print corresponding deprecation warning. The "everything"
level is not working as advertised for quite some time anyway.

This will allow us to gradually deprecate broken "everything" parameter
giving users enough time to update their config files before removing it
entirely.

Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f
Related: OS#71
---
M src/vty/logging_vty.c
1 file changed, 9 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 758f0b9..01480b1 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -213,6 +213,11 @@
 		return CMD_WARNING;
 	}
 
+	if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */
+		vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE);
+		return CMD_SUCCESS;
+	}
+
 	/* Check for special case where we want to set global log level */
 	if (!strcmp(argv[0], "all")) {
 		log_set_log_level(tgt, level);
@@ -730,8 +735,10 @@
 		osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1);
 		osmo_str2lower(level_lower, log_level_str(cat->loglevel));
 
-		vty_out(vty, "  logging level %s %s%s", cat_lower, level_lower,
-			VTY_NEWLINE);
+		if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */
+			vty_out(vty, "  logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE);
+		else
+			LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n");
 	}
 
 	/* FIXME: levels */

-- 
To view, visit https://gerrit.osmocom.org/3148
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list