From 11e2e30360a24bcc22ca4231fca495e5d846abb5 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Mon, 7 May 2007 21:51:40 +0000 Subject: Imported bm-2.1 from svn+ssh://svn.mandriva.com/svn/packages/cooker/bm/current/SOURCES/bm-2.1.tar.bz2 at r24959. --- BuildManager/__init__.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 BuildManager/__init__.py (limited to 'BuildManager/__init__.py') diff --git a/BuildManager/__init__.py b/BuildManager/__init__.py new file mode 100644 index 0000000..eea669a --- /dev/null +++ b/BuildManager/__init__.py @@ -0,0 +1,24 @@ +import logging +import sys, os + +__all__ = ["Error", "logger"] + +class Error(Exception): pass + +def getlogger(): + class Formatter(logging.Formatter): + def format(self, record): + if record.levelname == "INFO": + record.llevelname = "" + else: + record.llevelname = record.levelname.lower()+": " + return logging.Formatter.format(self, record) + formatter = Formatter("%(llevelname)s%(message)s") + handler = logging.StreamHandler(sys.stderr) + handler.setFormatter(formatter) + logger = logging.getLogger("bm") + logger.addHandler(handler) + return logger + +logger = getlogger() + -- cgit v1.2.1