gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r168583 - in /gump/branches/Gump3/pygump: ./ python/gump/ python/gump/engine/ python/gump/plugins/ python/gump/util/
Date Fri, 06 May 2005 10:00:20 GMT
Author: leosimons
Date: Fri May  6 03:00:18 2005
New Revision: 168583

URL: http://svn.apache.org/viewcvs?rev=168583&view=rev
Log:
More pretty printing/cli updates, including a new -q/--quiet switch that suppresses quite
a bit more output.

Added:
    gump/branches/Gump3/pygump/gump.log.config.quiet
      - copied, changed from r168581, gump/branches/Gump3/pygump/gump.log.config
Modified:
    gump/branches/Gump3/pygump/gump.log.config
    gump/branches/Gump3/pygump/gump.log.config.debug
    gump/branches/Gump3/pygump/main.py
    gump/branches/Gump3/pygump/python/gump/config.py
    gump/branches/Gump3/pygump/python/gump/engine/__init__.py
    gump/branches/Gump3/pygump/python/gump/engine/verifier.py
    gump/branches/Gump3/pygump/python/gump/plugins/instrumentation.py
    gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py
    gump/branches/Gump3/pygump/python/gump/util/executor.py
    gump/branches/Gump3/pygump/python/gump/util/mysql.py

Modified: gump/branches/Gump3/pygump/gump.log.config
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/gump.log.config?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/gump.log.config (original)
+++ gump/branches/Gump3/pygump/gump.log.config Fri May  6 03:00:18 2005
@@ -1,6 +1,6 @@
 # not used atm..
 [loggers]
-keys=root,engine,modeller,walker,plugin,plugin_dynagumper,plugin_logger,util_db,util_executor
+keys=root,engine,modeller,walker,plugin,plugin_dynagumper,plugin_logger,plugin_logger_debug,util_db,util_executor
 
 [handlers]
 keys=stdout,filehandler
@@ -67,6 +67,12 @@
 propagate=0
 qualname=plugin.logger
 
+[logger_plugin_logger_debug]
+level=INFO
+handlers=stdout,filehandler
+propagate=0
+qualname=plugin.logger.debug
+
 [logger_plugin_builder]
 level=WARN
 handlers=stdout,filehandler
@@ -88,7 +94,8 @@
 #args=('work/log/run.log', 'W', '0', 10)
 
 [formatter_simple]
-format=%(levelname)s - %(message)s
+format=%(asctime)-8s %(levelname)-8s   %(message)s
+datefmt=%H:%M:%S
 
 [formatter_fileformatter]
 format=%(levelname)s [%(name)s] %(asctime)s: %(pathname)s:%(lineno)d: %(message)s

Modified: gump/branches/Gump3/pygump/gump.log.config.debug
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/gump.log.config.debug?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/gump.log.config.debug (original)
+++ gump/branches/Gump3/pygump/gump.log.config.debug Fri May  6 03:00:18 2005
@@ -1,6 +1,6 @@
 # not used atm..
 [loggers]
-keys=root,engine,modeller,walker,plugin,plugin_dynagumper,plugin_logger,util_db,util_executor
+keys=root,engine,modeller,walker,plugin,plugin_dynagumper,plugin_logger,plugin_logger_debug,util_db,util_executor
 
 [handlers]
 keys=stdout,filehandler
@@ -66,6 +66,12 @@
 handlers=stdout,filehandler
 propagate=0
 qualname=plugin.logger
+
+[logger_plugin_logger_debug]
+level=DEBUG
+handlers=stdout,filehandler
+propagate=0
+qualname=plugin.logger.debug
 
 [logger_plugin_builder]
 level=DEBUG

Copied: gump/branches/Gump3/pygump/gump.log.config.quiet (from r168581, gump/branches/Gump3/pygump/gump.log.config)
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/gump.log.config.quiet?p2=gump/branches/Gump3/pygump/gump.log.config.quiet&p1=gump/branches/Gump3/pygump/gump.log.config&r1=168581&r2=168583&rev=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/gump.log.config (original)
+++ gump/branches/Gump3/pygump/gump.log.config.quiet Fri May  6 03:00:18 2005
@@ -1,6 +1,6 @@
 # not used atm..
 [loggers]
-keys=root,engine,modeller,walker,plugin,plugin_dynagumper,plugin_logger,util_db,util_executor
+keys=root,engine,modeller,walker,plugin,plugin_dynagumper,plugin_logger,plugin_logger_debug,util_db,util_executor
 
 [handlers]
 keys=stdout,filehandler
@@ -9,54 +9,54 @@
 keys=simple,fileformatter
 
 [logger_root]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 
 [logger_engine]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=engine
 
 [logger_modeller]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=modeller
 
 [logger_walker]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=walker
 
 [logger_plugin]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=plugin
 
 [logger_util_db]
-level=INFO
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=util.db
 
 [logger_util_executor]
-level=INFO
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=util.executor
 
 [logger_plugin_error-handler]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=plugin.error-handler
 
 [logger_plugin_dynagumper]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=plugin.dynagumper
@@ -67,8 +67,14 @@
 propagate=0
 qualname=plugin.logger
 
+[logger_plugin_logger_debug]
+level=ERROR
+handlers=stdout,filehandler
+propagate=0
+qualname=plugin.logger.debug
+
 [logger_plugin_builder]
-level=WARN
+level=ERROR
 handlers=stdout,filehandler
 propagate=0
 qualname=plugin.builder
@@ -88,7 +94,8 @@
 #args=('work/log/run.log', 'W', '0', 10)
 
 [formatter_simple]
-format=%(levelname)s - %(message)s
+format=%(asctime)-8s %(levelname)-8s   %(message)s
+datefmt=%H:%M:%S
 
 [formatter_fileformatter]
 format=%(levelname)s [%(name)s] %(asctime)s: %(pathname)s:%(lineno)d: %(message)s

Modified: gump/branches/Gump3/pygump/main.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/main.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/main.py (original)
+++ gump/branches/Gump3/pygump/main.py Fri May  6 03:00:18 2005
@@ -74,13 +74,19 @@
     """
     # TODO: make sure no CLI settings are overridden!
     from optparse import OptionParser
-    usage = "$0 run [options ...]"
+    usage = "gump run [options ...]"
 
     parser = OptionParser(usage=usage)
-    parser.add_option("--debug",
+    parser.add_option("-d",
+                      "--debug",
                       action="store_true",
                       default=False,
                       help="print extra information")
+    parser.add_option("-q",
+                      "--quiet",
+                      action="store_true",
+                      default=False,
+                      help="print as little information as possible (overrides --debug)")
     parser.add_option("--homedir",
                       action="store",
                       default=_homedir,
@@ -102,7 +108,8 @@
                       action="store",
                       default=_workspace,
                       help="absolute path to the workspace gump will use")
-    parser.add_option("--do-updates",
+    parser.add_option("-u",
+                      "--do-updates",
                       action="store_true",
                       dest="do_update",
                       default=False, # Default to NOT. At least during initial development...
@@ -127,7 +134,7 @@
                       action="store",
                       default=_databasepassword,
                       help="password gump will use to connect to the database")
-    parser.add_option("--enable-colors",
+    parser.add_option("--color",
                       action="store_true",
                       dest="enable_colors",
                       default=False,

Modified: gump/branches/Gump3/pygump/python/gump/config.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Fri May  6 03:00:18 2005
@@ -51,6 +51,9 @@
         config.log_level       = logging.DEBUG
     else:
         config.log_level       = logging.INFO
+    if settings.quiet:
+        settings.debug = False
+        config.log_level = logging.WARN
     
     # TODO: change main.py to do it like this
     config.paths_home      = settings.homedir
@@ -111,9 +114,9 @@
         
     from gump.plugins import LoggingPlugin
 
-    reportlog = get_logger(config, "plugin.logger")
+    debuglog = get_logger(config, "plugin.logger.debug")
     from gump.plugins.logreporter import DebugLogReporterPlugin
-    plugins.append(DebugLogReporterPlugin(reportlog))
+    plugins.append(DebugLogReporterPlugin(debuglog))
         
     if config.do_update:    
         plugins.append(TimerPlugin("update_start"))
@@ -149,9 +152,9 @@
     dynagumplog = get_logger(config, "plugin.dynagumper")
     post_process_plugins.append(Dynagumper(db, dynagumplog))
     
-    if config.debug:
-        from gump.plugins.logreporter import OutputLogReporterPlugin
-        post_process_plugins.append(OutputLogReporterPlugin(reportlog))
+    reportlog = get_logger(config, "plugin.logger")
+    from gump.plugins.logreporter import OutputLogReporterPlugin
+    post_process_plugins.append(OutputLogReporterPlugin(reportlog))
 
     from gump.plugins.logreporter import ResultLogReporterPlugin
     post_process_plugins.append(ResultLogReporterPlugin(reportlog))
@@ -317,7 +320,10 @@
     if config.debug:
         fileConfig('gump.log.config.debug')
     else:
-        fileConfig('gump.log.config')
+        if config.quiet:
+            fileConfig('gump.log.config.quiet')
+        else:
+            fileConfig('gump.log.config')
     
     # set up gump.util.executor module
     # this will make Popen log all invocations

Modified: gump/branches/Gump3/pygump/python/gump/engine/__init__.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/__init__.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/__init__.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/__init__.py Fri May  6 03:00:18 2005
@@ -83,7 +83,8 @@
         from gump.util import ansicolor
         ansicolor.enable_colors()
 
-    _banner(settings.version)
+    if not settings.quiet:
+        _banner(settings.version)
     
     # get engine config
     config = get_config(settings)
@@ -121,11 +122,11 @@
 def _banner(version):
     """Print a fancy ASCII-art gump logo."""
     print ansicolor.Bright_Blue
-    print "         _____"
-    print "        |   __|_ " + ansicolor.Red + "Apache" + ansicolor.Bright_Blue + "_ ___"
-    print "        |  |  | | |     | . |"
-    print "        |_____|___|_|_|_|  _|"
-    print "                        |_|     " + ansicolor.Blue + "~ v. " + version + " ~"
+    print "                  _____"
+    print "                 |   __|_ " + ansicolor.Red + "Apache" + ansicolor.Bright_Blue
+ "_ ___"
+    print "                 |  |  | | |     | . |"
+    print "                 |_____|___|_|_|_|  _|"
+    print "                                 |_|     " + ansicolor.Blue + "~ v. " + version
+ " ~"
     print ansicolor.Black
 
 

Modified: gump/branches/Gump3/pygump/python/gump/engine/verifier.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/verifier.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/verifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/verifier.py Fri May  6 03:00:18 2005
@@ -46,9 +46,11 @@
 def print_cyclic_trace(cycles, handler):
     for cycle in cycles: # isn't there a level of nesting too much here???
         for chain in cycle:
-            msg = "  "
+            msg = ""
+            indent = "  "
             for project in chain:
-                msg += "%s --> " % project.name
+                msg += "%s%s -->\n" % (indent, project.name)
+                indent += "  "
             msg = ansicolor.Bright_Red + msg[:-5] + ansicolor.Black
             handler(msg)
     

Modified: gump/branches/Gump3/pygump/python/gump/plugins/instrumentation.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/instrumentation.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/instrumentation.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/instrumentation.py Fri May  6 03:00:18
2005
@@ -41,4 +41,4 @@
 
     def gettime(self):
         import time
-        return time.strftime(self.format, time.gmtime())
+        return time.strftime(self.format, time.localtime())

Modified: gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py Fri May  6 03:00:18 2005
@@ -25,7 +25,7 @@
 
 from StringIO import StringIO
 
-hr = '------------------------------------------------------------------------'
+hr = '  --------------------------------------------------------------------------'
 
 class DebugLogReporterPlugin(AbstractPlugin):
     """Outputs debug messages as it visits model elements."""
@@ -107,7 +107,7 @@
     
     def initialize(self):
         self.wr(hr)
-        self.wr('                           %sBUILD RESULTS%s' % (ansicolor.Bright_Blue,
ansicolor.Black))
+        self.wr('                              %sBUILD RESULTS%s' % (ansicolor.Bright_Blue,
ansicolor.Black))
         self.wr(hr)
     
     def visit_workspace(self, workspace):
@@ -151,51 +151,58 @@
         success_percent = (1.0 * success / total) * total_percent
         cycled_percent = (1.0 * cycled / total) * total_percent
         
-        self.wr('  Project build statistics:')
-        self.wr('Total   %sFailed   %sPrereq Failed   Skipped   %sSuccess   %sCyclic Dependency%s'
% \
+        self.wr('  Project build statistics')
+        self.wr('  ==========================================================================')
+        self.wr('      Total | %sFailed | %sPrereq Failed | Skipped | %sSuccess | %sCyclic
Dependency%s' % \
                 (ansicolor.Red, ansicolor.Yellow, ansicolor.Green, ansicolor.Bright_Red,
ansicolor.Black))
-        self.wr('%5u   %s%6u   %s%13u   %7u   %s%7u   %s%17u%s' % (total,
-                 ansicolor.Red, failed,
-                 ansicolor.Yellow, prereq_failed, skipped,
-                 ansicolor.Green, success,
+        self.wr('      ------|--------|---------------|---------|---------|------------------')
+        self.wr('      %5u | %s%6u%s | %s%13u%s | %s%7u%s | %s%7u%s | %s%17u%s' % (total,
+                 ansicolor.Red, failed, ansicolor.Black, 
+                 ansicolor.Yellow, prereq_failed, ansicolor.Black,
+                 ansicolor.Yellow, skipped, ansicolor.Black, 
+                 ansicolor.Green, success, ansicolor.Black, 
                  ansicolor.Bright_Red, cycled,
                  ansicolor.Black))
-        self.wr('%5.0f%%  %s%6.1f%%  %s%13.1f%%  %7.1f%%  %s%7.1f%%  %s%17.1f%%%s' % (total_percent,
-                 ansicolor.Red, failed_percent,
-                 ansicolor.Yellow, prereq_failed_percent, skipped_percent,
-                 ansicolor.Green, success_percent,
+        self.wr('     %5.0f%% |%s%6.1f%%%s |%s%13.1f%%%s |%s%7.1f%%%s |%s%7.1f%%%s |%s%17.1f%%%s'
% (total_percent,
+                 ansicolor.Red, failed_percent, ansicolor.Black, 
+                 ansicolor.Yellow, prereq_failed_percent, ansicolor.Black,
+                 ansicolor.Yellow, skipped_percent, ansicolor.Black, 
+                 ansicolor.Green, success_percent, ansicolor.Black, 
                  ansicolor.Bright_Red, cycled_percent,
                  ansicolor.Black))
-        self.wr(hr)
+        self.wr('  ==========================================================================')
+        self.wr('')
+        self.wr('  Project build log')
+        self.wr('  ==========================================================================')
         
         if hasattr(workspace, "unvisited"):
             for project in workspace.unvisited:
-                self.wr('%s%s: CYCLIC DEPENDENCY%s' % (ansicolor.Bright_Red, project, ansicolor.Black))
+                self.wr('  %s%s: CYCLIC DEPENDENCY%s' % (ansicolor.Bright_Red, project, ansicolor.Black))
  
     def visit_project(self, project):
         if check_skip(project):
-            self.wr('%s%s: SKIPPED%s' % (ansicolor.Blue, project, ansicolor.Black))
+            self.wr('  %s%s: SKIPPED%s' % (ansicolor.Blue, project, ansicolor.Black))
             return
         
         if not check_failure(project):
-            self.wr('%s%s: OK%s' % (ansicolor.Green, project, ansicolor.Black))
+            self.wr('  %s%s: OK%s' % (ansicolor.Green, project, ansicolor.Black))
         else:
-            self.wr('%s%s: FAIL%s' % (ansicolor.Red, project, ansicolor.Black+ansicolor.Black))
+            self.wr('  %s%s: FAIL%s' % (ansicolor.Red, project, ansicolor.Black+ansicolor.Black))
 
             causes = get_failure_causes(project)
             for cause in causes:
                 if isinstance(cause, ExceptionInfo):
-                    self.wr("    %sMETADATA FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
+                    self.wr("      %sMETADATA FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
                 if isinstance(cause, Command):
-                    self.wr("    %sBUILD FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
+                    self.wr("      %sBUILD FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
                 if isinstance(cause, Dependency):
-                    self.wr("    %sPREREQ FAILURE (%s)%s" % (ansicolor.Red, cause.dependency,
ansicolor.Black))
+                    self.wr("      %sPREREQ FAILURE (%s)%s" % (ansicolor.Red, cause.dependency,
ansicolor.Black))
                 if isinstance(cause, Project):
-                    self.wr("    %sPREREQ FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
+                    self.wr("      %sPREREQ FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
                 if isinstance(cause, Module):
-                    self.wr("    %sUPDATE FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
+                    self.wr("      %sUPDATE FAILURE (%s)%s" % (ansicolor.Red, cause, ansicolor.Black))
                 
-                indent =    "     "
+                indent =    "       "
                 for trace_elem in get_root_cause(cause):
                     real_elem = trace_elem
                     if isinstance(trace_elem, Dependency):
@@ -207,7 +214,7 @@
                     indent += "  "
                     
     def finalize(self):
-        self.wr(hr)
+        self.wr('  ==========================================================================')
         
         self.buffer.flush()
         self.log.info(self.buffer.getvalue())

Modified: gump/branches/Gump3/pygump/python/gump/util/executor.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/util/executor.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/util/executor.py (original)
+++ gump/branches/Gump3/pygump/python/gump/util/executor.py Fri May  6 03:00:18 2005
@@ -121,7 +121,7 @@
             
             # a logger can be set for this module to make us log commands
             if _log:
-                _log.info("        Executing command: %s'%s'%s in directory '%s'" % (ansicolor.Blue,
" ".join(args), ansicolor.Black, os.path.abspath(cwd or os.curdir)))
+                _log.info("        Executing command:\n      %s'%s'%s\n       in directory
'%s'" % (ansicolor.Blue, " ".join(args), ansicolor.Black, os.path.abspath(cwd or os.curdir)))
             
             subprocess.Popen.__init__(self, args, bufsize=bufsize, executable=executable,
                      stdin=stdin, stdout=stdout, stderr=stderr,

Modified: gump/branches/Gump3/pygump/python/gump/util/mysql.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/util/mysql.py?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/util/mysql.py (original)
+++ gump/branches/Gump3/pygump/python/gump/util/mysql.py Fri May  6 03:00:18 2005
@@ -91,7 +91,7 @@
                 
             return (affected, None)
         finally:
-            self.log.info("        Executed SQL statement: %s%s%s ...%s rows affected." %
(ansicolor.Blue, statement, ansicolor.Black, affected))
+            self.log.info("        Executed SQL statement:\n      %s%s%s\n        ...%s rows
affected." % (ansicolor.Blue, statement, ansicolor.Black, affected))
             if cursor: cursor.close()
     
     def _connection(self):



Mime
View raw message