aboutsummaryrefslogtreecommitdiff
path: root/linaro-hwpack-replace
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2012-10-20 09:17:46 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2012-10-20 09:17:46 +0300
commitfa407e3065ae0e54232b9f719d9db86c3a67c040 (patch)
tree35d94ed32fcf2496a1f760556e616a80dd1b2f9a /linaro-hwpack-replace
parentb21d6e2ac0a693009abca7ecff545572156f3fe1 (diff)
downloadlinaro-image-tools-fa407e3065ae0e54232b9f719d9db86c3a67c040.tar.gz
Revert the use of common logging infrastructure.
Diffstat (limited to 'linaro-hwpack-replace')
-rwxr-xr-xlinaro-hwpack-replace20
1 files changed, 17 insertions, 3 deletions
diff --git a/linaro-hwpack-replace b/linaro-hwpack-replace
index a8d9d78..e7f2336 100755
--- a/linaro-hwpack-replace
+++ b/linaro-hwpack-replace
@@ -26,6 +26,7 @@ import os
import sys
import shutil
import glob
+import logging
import tarfile
import tempfile
import argparse
@@ -34,7 +35,6 @@ import fileinput
from debian.deb822 import Packages
from linaro_image_tools.hwpack.packages import get_packages_file
from linaro_image_tools.hwpack.packages import FetchedPackage
-from linaro_image_tools.utils import get_logger
parser = argparse.ArgumentParser()
@@ -53,7 +53,7 @@ parser.add_argument("-i", "--in-place", action="store_true", dest="inplace",
parser.add_argument("-d", "--debug-output", action="store_true", dest="debug",
help="Verbose messages are displayed when specified")
-logger = None
+logger = logging.getLogger("linaro-hwpack-replace")
class DummyStanza(object):
@@ -65,6 +65,20 @@ class DummyStanza(object):
fd.write(get_packages_file([self.info]))
+def set_logging_param(args):
+ ch = logging.StreamHandler()
+ ch.setLevel(logging.INFO)
+ formatter = logging.Formatter("%(message)s")
+ ch.setFormatter(formatter)
+ logger.setLevel(logging.INFO)
+ logger.addHandler(ch)
+ if args.debug:
+ ch.setLevel(logging.DEBUG)
+ formatter = logging.Formatter(
+ "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
+ ch.setFormatter(formatter)
+ logger.setLevel(logging.DEBUG)
+
def get_hwpack_name(old_hwpack, build_number):
# The build_number would be the job build number.
@@ -164,7 +178,7 @@ def main():
"and the debian package information\n")
return 1
- logger = get_logger(debug=args.debug)
+ set_logging_param(args)
old_hwpack = args.hwpack_name
new_deb_file_to_copy = args.deb_pack