Skip to content

Commit

Permalink
Added the --debug command line flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
cganterh committed Jul 3, 2017
1 parent 455d8b7 commit 3580c41
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions le.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@

def run():
"""Run all handlers in the group ``le.handlers``."""
parser = ArgumentParser(fromfile_prefix_chars='@')
parser.add_argument('telegram_token')
parser.add_argument('-d', '--debug', action='store_true')
args = parser.parse_args()

logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO
level=logging.DEBUG if args.debug else logging.INFO
)

parser = ArgumentParser(fromfile_prefix_chars='@')
parser.add_argument('telegram_token')
args = parser.parse_args()
logging.getLogger('telegram.ext').setLevel(logging.INFO)
logging.getLogger('telegram.bot').setLevel(logging.INFO)
logging.getLogger('telegram.vendor').setLevel(logging.INFO)

updater = Updater(token=args.telegram_token)

Expand Down

0 comments on commit 3580c41

Please sign in to comment.