summaryrefslogtreecommitdiffstats
path: root/BuildManager/__init__.py
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-05-07 21:51:40 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-05-07 21:51:40 +0000
commit11e2e30360a24bcc22ca4231fca495e5d846abb5 (patch)
tree9bf91715b22e91a7b739c72a08f6a3f4395c1c25 /BuildManager/__init__.py
downloadbm-2.1.tar
bm-2.1.tar.gz
bm-2.1.tar.bz2
bm-2.1.tar.xz
bm-2.1.zip
Imported bm-2.1 from2.1
svn+ssh://svn.mandriva.com/svn/packages/cooker/bm/current/SOURCES/bm-2.1.tar.bz2 at r24959.
Diffstat (limited to 'BuildManager/__init__.py')
-rw-r--r--BuildManager/__init__.py24
1 files changed, 24 insertions, 0 deletions
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()
+