Add --debug option to replace TOOT_DEBUG env - toot - Unnamed repository; edit … | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit e4c3a8504599432b65c8e1c21aab644aec3327b1 | |
parent 3b13c4914264260987ba2cfd0503aa4262876bca | |
Author: Ivan Habunek <[email protected]> | |
Date: Sat, 26 Aug 2017 15:12:32 +0200 | |
Add --debug option to replace TOOT_DEBUG env | |
Diffstat: | |
CHANGELOG.md | 8 +++++++- | |
toot/console.py | 8 +++++++- | |
2 files changed, 14 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/CHANGELOG.md b/CHANGELOG.md | |
@@ -1,10 +1,16 @@ | |
Changelog | |
--------- | |
+**0.14.0 (TBA)** | |
+ | |
+* Add `--debug` option to enable debug logging instead of using the `TOOT_DEBU… | |
+ environment variable. | |
+ | |
**0.13.0 (2017-08-26)** | |
* Allow passing `--instance` and `--email` to login command | |
-* Add `login_browser` command for proper two factor authentication through the… | |
+* Add `login_browser` command for proper two factor authentication through the | |
+ browser (#19, #23) | |
**0.12.0 (2017-05-08)** | |
diff --git a/toot/console.py b/toot/console.py | |
@@ -31,6 +31,11 @@ common_args = [ | |
"help": "don't use ANSI colors in output", | |
"action": 'store_true', | |
"default": False, | |
+ }), | |
+ (["--debug"], { | |
+ "help": "show debug log in console", | |
+ "action": 'store_true', | |
+ "default": False, | |
}) | |
] | |
@@ -279,7 +284,8 @@ def run_command(app, user, name, args): | |
def main(): | |
- if os.getenv('TOOT_DEBUG'): | |
+ # Enable debug log if --debug is in args | |
+ if "--debug" in sys.argv: | |
logging.basicConfig(level=logging.DEBUG) | |
# If something is piped in, append it to commandline arguments |