[Piuparts-commits] rev 649 - in trunk: . debian

Holger Levsen holger at alioth.debian.org
Tue Feb 23 09:34:04 UTC 2010


Author: holger
Date: 2010-02-23 09:34:03 +0000 (Tue, 23 Feb 2010)
New Revision: 649

Modified:
   trunk/debian/changelog
   trunk/piuparts.1.txt
   trunk/piuparts.py
Log:
piuparts.py: new option --log-level to specify the verbosity of piuparts
output. Thanks to Fabrice Coutadeur for the patch! (Closes: #567190)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2010-02-23 09:25:55 UTC (rev 648)
+++ trunk/debian/changelog	2010-02-23 09:34:03 UTC (rev 649)
@@ -23,6 +23,8 @@
     - fix crash when going into sleep when idle. 
     - add support for only doing upgrade tests (without the basic test in the
       upgrade target distro). 
+  * piuparts.py: new option --log-level to specify the verbosity of piuparts
+    output. Thanks to Fabrice Coutadeur for the patch! (Closes: #567190)
   * Add ${misc:Depends} to Depends in debian/control. 
   * Makefile: support python 2.5 and 2.6 instead of 2.4 and 2.5, adjust
     debian/control accordingly.

Modified: trunk/piuparts.1.txt
===================================================================
--- trunk/piuparts.1.txt	2010-02-23 09:25:55 UTC (rev 648)
+++ trunk/piuparts.1.txt	2010-02-23 09:34:03 UTC (rev 649)
@@ -92,6 +92,9 @@
 *-l* 'filename', *--log-file*='filename'::
   Write log file to _filename_ in addition to the standard output.
 
+*--log-level*='level'::
+  Display messages from loglevel LEVEL, possible values are: error, info, dump, debug. The default is dump.
+
 *-m* 'url', *--mirror*='url'::
   Which Debian mirror to use. The default is the first mirror named in _/etc/apt/sources.list_ or _http://ftp.debian.org/_ if none is found. This option may be used multiple times to use multiple mirrors. Only the first mirror is used with *debootstrap*.
 +

Modified: trunk/piuparts.py
===================================================================
--- trunk/piuparts.py	2010-02-23 09:25:55 UTC (rev 648)
+++ trunk/piuparts.py	2010-02-23 09:34:03 UTC (rev 649)
@@ -794,6 +794,8 @@
                 self.run(["dpkg", "-i"] + tmp_files, ignore_errors=True)
                 self.run(["apt-get", "-yf", "--no-remove", "install"])
 
+            logging.info ("Installation of %s ok", tmp_files)
+
             if settings.scriptsdir is not None:
                 self.run_scripts("post_install")
 
@@ -1972,6 +1974,10 @@
                       default=False,
                       help="Warn only for broken symlinks.")
     
+    parser.add_option("--log-level", action="store",metavar='LEVEL',
+                      default="dump",
+                      help="Displays messages from LEVEL level, possible values are: error, info, dump, debug. The default is dump.")
+
     (opts, args) = parser.parse_args()
 
     settings.defaults = opts.defaults
@@ -2029,7 +2035,14 @@
                           settings.tmpdir)
             panic()
 
-    setup_logging(DUMP, log_file_name)
+    if opts.log_level == "error":
+        setup_logging(logging.ERROR, log_file_name)
+    elif opts.log_level == "info":
+        setup_logging(logging.INFO, log_file_name)
+    elif opts.log_level == "debug":
+        setup_logging(logging.DEBUG, log_file_name)
+    else:
+        setup_logging(DUMP, log_file_name)
 
     exit = None
 




More information about the Piuparts-commits mailing list