Skip to content

Commit

Permalink
Change --verbose to set the logger level to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc committed Mar 12, 2016
1 parent 8e71d04 commit 49dca39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions dbmigrator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
handler.setFormatter(logging.Formatter(
'[%(levelname)s] %(name)s (%(filename)s) - %(message)s'))
logger.addHandler(handler)


__all__ = ('logger',)
6 changes: 4 additions & 2 deletions dbmigrator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
# ###
from __future__ import print_function
import argparse
import logging
import os
import sys

import pkg_resources

from . import commands, utils
from . import commands, utils, logger


DEFAULTS = {
Expand Down Expand Up @@ -81,6 +82,7 @@ def main(argv=sys.argv[1:]):
print('migrations directory undefined', file=sys.stderr)

if args.get('verbose'):
print('args: {}'.format(args))
logger.setLevel(logging.DEBUG)
logger.debug('args: {}'.format(args))

return args['cmmd'](**args)

0 comments on commit 49dca39

Please sign in to comment.