python-coloredlogs icon indicating copy to clipboard operation
python-coloredlogs copied to clipboard

Error output in app.run(main)

Open 12343954 opened this issue 5 years ago • 0 comments

image

duplicate rows show out, what can i do? thank you

from absl import app, flags
import coloredlogs
import logging


def main(_args):
    logger = logging.getLogger(__name__)
    coloredlogs.install(level='DEBUG', logger=logger,
                        fmt='%(asctime)s [%(filename)s:%(lineno)d] %(levelname)-8s %(message)s',
                        # datefmt='%Y-%m-%d %H:%I:%S',
                        datefmt='%H:%I:%S',
                        isatty=True
                        )

    logger.info("this is an informational message")
    logger.warning("this is an informational message")
    logger.fatal("this is an informational message")
    logger.error("this is an informational message")
    logger.debug(logger.__dir__)


if __name__ == "__main__":
    try:
        app.run(main)
        # main(1)
    except Exception as ex:
        print(ex)
    except SystemExit:
        pass

12343954 avatar Feb 25 '20 06:02 12343954