subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1326571 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py
Date Mon, 16 Apr 2012 12:17:15 GMT
Author: danielsh
Date: Mon Apr 16 12:17:15 2012
New Revision: 1326571

URL: http://svn.apache.org/viewvc?rev=1326571&view=rev
Log:
Make --set-log-level support Python 2.6.

* subversion/tests/cmdline/main.py
  (_create_parser.set_log_level):
    Don't pass strings to setLevel().  Add comments.
  (_create_parser): Add a help string to '--set-log-level'.

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1326571&r1=1326570&r2=1326571&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Mon Apr 16 12:17:15 2012
@@ -1481,9 +1481,11 @@ def _create_parser():
   """Return a parser for our test suite."""
   def set_log_level(option, opt, value, parser, level=None):
     if level:
+      # called from --verbose
       logger.setLevel(level)
     else:
-      logger.setLevel(value)
+      # called from --set-log-level
+      logger.setLevel(getattr(logging, value, None) or int(value))
 
   # set up the parser
   _default_http_library = 'serf'
@@ -1535,7 +1537,8 @@ def _create_parser():
   parser.add_option('--config-file', action='store',
                     help="Configuration file for tests.")
   parser.add_option('--set-log-level', action='callback', type='str',
-                    callback=set_log_level)
+                    callback=set_log_level,
+		    help="Set log level (numerically or symbolically)")
   parser.add_option('--keep-local-tmp', action='store_true',
                     help="Don't remove svn-test-work/local_tmp after test " +
                          "run is complete.  Useful for debugging failures.")



Mime
View raw message