[Piuparts-commits] [piuparts] 03/09: dwke: prepare switching to logging
Holger Levsen
holger at moszumanska.debian.org
Sun Feb 9 20:59:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit 2b6bce403b70461f023e60ec3bbe38dde869bb1f
Author: Andreas Beckmann <anbe at debian.org>
Date: Sun Feb 9 16:55:18 2014 +0100
dwke: prepare switching to logging
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
master-bin/detect_well_known_errors.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index efbc2ce..5dd206d 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright 2013 David Steele (dsteele at gmail.com)
+# Copyright © 2014 Andreas Beckmann (anbe at debian.org)
#
# This file is part of Piuparts
#
@@ -18,9 +19,12 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, see <http://www.gnu.org/licenses/>.
+
import ConfigParser
import os
+import sys
import time
+import logging
import re
from collections import namedtuple
import argparse
@@ -100,6 +104,14 @@ class WKE_Section_Config(piupartslib.conf.Config):
"upgrade-test-distros": None,
}, "", defaults_section="global")
+
+def setup_logging(log_level):
+ logger = logging.getLogger()
+ logger.setLevel(log_level)
+ handler = logging.StreamHandler(sys.stdout)
+ logger.addHandler(handler)
+
+
class Problem():
""" Encapsulate a particular known problem """
@@ -522,6 +534,7 @@ def create_problem_list(pdir):
return plist
if __name__ == '__main__':
+ setup_logging(logging.DEBUG)
parser = argparse.ArgumentParser(
description="Detect/process well known errors to html",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list