From 643dc3f561958d06d1b70ff625befc8a2144ee44 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Sun, 10 Mar 2019 10:51:36 -0400 Subject: [PATCH] updated granularity of logging - include warning --- apprise/cli.py | 7 +++++-- test/test_cli.py | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apprise/cli.py b/apprise/cli.py index c8bf4d21..b739e60b 100644 --- a/apprise/cli.py +++ b/apprise/cli.py @@ -41,7 +41,7 @@ from . import __license__ from . import __copywrite__ # Logging -logger = logging.getLogger('apprise.plugins.NotifyBase') +logger = logging.getLogger('apprise') # Defines our click context settings adding -h to the additional options that # can be specified to get the help menu to come up @@ -112,9 +112,12 @@ def main(title, body, config, urls, notification_type, theme, tag, verbose, if verbose > 2: logger.setLevel(logging.DEBUG) - elif verbose == 1: + elif verbose > 1: logger.setLevel(logging.INFO) + elif verbose > 0: + logger.setLevel(logging.WARNING) + else: logger.setLevel(logging.ERROR) diff --git a/test/test_cli.py b/test/test_cli.py index 9b349d81..8bd0dee0 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -74,6 +74,9 @@ def test_apprise_cli(tmpdir): result = runner.invoke(cli.main, ['-vvv']) assert result.exit_code == 1 + result = runner.invoke(cli.main, ['-vvvv']) + assert result.exit_code == 1 + # Display version information and exit result = runner.invoke(cli.main, ['-V']) assert result.exit_code == 0