Skip to content

Commit 81d6150

Browse files
author
Hugo Osvaldo Barrera
committed
Reintroduce click-log
Looks like passing the root logger could have solved our issue with it last time. This is also now the default too. 🎉
1 parent 5dc49b2 commit 81d6150

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Changelog
44
This file contains a brief summary of new features and dependency changes or
55
releases, in reverse chronological order.
66

7+
v3.3.0
8+
------
9+
10+
* New runtime dependency: ``click-log``.
11+
712
v3.2.4
813
------
914

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
atomicwrites
22
click>=6.0
3+
click_log
34
configobj
45
humanize
56
icalendar

todoman/cli.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
import functools
22
import glob
33
import locale
4-
import logging
54
import sys
65
from contextlib import contextmanager
76
from datetime import timedelta
87
from os.path import expanduser, isdir
98

109
import click
10+
import click_log
1111

1212
from todoman import exceptions, formatters
1313
from todoman.configuration import ConfigurationException, load_config
1414
from todoman.interactive import TodoEditor
1515
from todoman.model import cached_property, Database, Todo
1616

1717

18+
click_log.basic_config()
19+
20+
1821
@contextmanager
1922
def handle_error():
2023
try:
@@ -194,13 +197,7 @@ def formatter(self):
194197

195198

196199
@click.group(invoke_without_command=True)
197-
@click.option(
198-
'-v',
199-
'--verbosity',
200-
type=click.Choice(['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG']),
201-
help='Set verbosity to the given level.',
202-
default='WARNING',
203-
)
200+
@click_log.simple_verbosity_option(None)
204201
@click.option('--colour', '--color', default=None,
205202
type=click.Choice(['always', 'auto', 'never']),
206203
help=('By default todoman will disable colored output if stdout '
@@ -214,8 +211,7 @@ def formatter(self):
214211
@click.pass_context
215212
@click.version_option(prog_name='todoman')
216213
@catch_errors
217-
def cli(click_ctx, color, porcelain, humanize, verbosity):
218-
logging.basicConfig(level=verbosity)
214+
def cli(click_ctx, color, porcelain, humanize):
219215
ctx = click_ctx.ensure_object(AppContext)
220216
try:
221217
ctx.config = load_config()

0 commit comments

Comments
 (0)