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

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