Migrator script output tweaks, debug logging
This commit is contained in:
parent
73acde8e69
commit
6dcb4fdfa4
13
cli-v1-to-v2
13
cli-v1-to-v2
@ -25,6 +25,9 @@ def main(sysargs=sys.argv[:]):
|
|||||||
action='store_true', default=False)
|
action='store_true', default=False)
|
||||||
parser.add_argument('-q', '--quiet', help='quiet down the logging',
|
parser.add_argument('-q', '--quiet', help='quiet down the logging',
|
||||||
action='store_true', default=False)
|
action='store_true', default=False)
|
||||||
|
parser.add_argument('-D', '--debug', help='debug up the logging',
|
||||||
|
action='store_true',
|
||||||
|
default=(os.environ.get('DEBUG') != ''))
|
||||||
parser.add_argument('--selftest', help='run internal tests',
|
parser.add_argument('--selftest', help='run internal tests',
|
||||||
action='store_true', default=False)
|
action='store_true', default=False)
|
||||||
|
|
||||||
@ -38,10 +41,10 @@ def main(sysargs=sys.argv[:]):
|
|||||||
test_migrators()
|
test_migrators()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
logging.basicConfig(
|
level = logging.FATAL if args.quiet else logging.INFO
|
||||||
level=(logging.FATAL if args.quiet else logging.INFO),
|
level = logging.DEBUG if args.debug else level
|
||||||
format='%(message)s'
|
|
||||||
)
|
logging.basicConfig(level=level, format='%(message)s')
|
||||||
|
|
||||||
paths = args.path
|
paths = args.path
|
||||||
if len(paths) == 0:
|
if len(paths) == 0:
|
||||||
@ -90,7 +93,7 @@ def _update_filepath(filepath):
|
|||||||
|
|
||||||
def _update_source(source):
|
def _update_source(source):
|
||||||
for migrator, func in _MIGRATORS:
|
for migrator, func in _MIGRATORS:
|
||||||
logging.info('Running %s migrator', migrator)
|
logging.debug('Running %s migrator', migrator)
|
||||||
source = func(source)
|
source = func(source)
|
||||||
return source
|
return source
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user