File: custom_logger

package info (click to toggle)
python-milc 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 788 kB
  • sloc: python: 1,868; sh: 55; makefile: 3
file content (27 lines) | stat: -rwxr-xr-x 513 bytes parent folder | download
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()