1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#!/usr/bin/env python3
"""Hello World implementation using MILC.
PYTHON_ARGCOMPLETE_OK
"""
import logging
from milc import cli
# Setup external logger
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('custom_logger')
cli.milc_options(logger=logging.getLogger('custom_logger'))
# Import milc
from milc import cli
@cli.entrypoint('Test a non-MILC logger.')
def main(cli):
cli.log.info('Hello Info World!')
cli.log.debug('Hello Debug World!')
if __name__ == '__main__':
cli()
|