12345678910111213141516171819202122 |
- #!/usr/bin/env python
- import os
- import logging
- import asyncio
- from rabbitmq_pdfparser import run
- logger = logging.getLogger("mq2mq-pdfparser")
- logger.setLevel(os.environ.get('LOG_LEVEL', "DEBUG"))
- handler = logging.StreamHandler()
- handler.setFormatter(
- logging.Formatter(
- os.environ.get('LOG_FORMAT', "%(asctime)s [%(levelname)s] %(name)s: %(message)s")
- )
- )
- logger.addHandler(handler)
- loop = asyncio.get_event_loop()
- loop.run_until_complete(run(loop=loop, logger=logger))
- loop.close()
|