You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
433 B

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from __future__ import unicode_literals
  4. import argparse
  5. import logging
  6. from doodbalib import LOG_LEVELS, logger
  7. parser = argparse.ArgumentParser(description="Easy logging for scripts")
  8. parser.add_argument("level", choices=LOG_LEVELS)
  9. parser.add_argument("message", nargs="+")
  10. arguments = parser.parse_args()
  11. logger.log(getattr(logging, arguments.level), " ".join(arguments.message))