]> git.ipfire.org Git - people/jschlag/network.git/commitdiff
CLI: Disable debugging for status commands.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 May 2012 12:07:41 +0000 (12:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 May 2012 12:07:41 +0000 (12:07 +0000)
When the debugging mode was enabled, the status
screen was cluttered with a lot of unneeded log lines.
The result was not readable at all.

This patch termporarily disables the output of log
messages to the console.

functions.cli

index ab2c091c3c47f918ff373dc844eb0d73a3d31249..554a6501dec12d66d67cc8975d4c43d8859b17be 100644 (file)
@@ -334,12 +334,21 @@ function cli_status() {
                exit ${EXIT_OK}
        fi
 
+       # When dumping status information, the debug
+       # mode clutters the console which is not what we want.
+       # Logging on the console is disabled for a short time.
+       local log_disable_stdout=${LOG_DISABLE_STDOUT}
+       LOG_DISABLE_STDOUT="true"
+
        local zones=$(zones_get $@)
 
        local zone
        for zone in ${zones}; do
                zone_status ${zone}
        done
+
+       # Reset logging.
+       LOG_DISABLE_STDOUT=${log_disable_stdout}
 }
 
 function cli_reset() {