main: Add --debug option to increase verbosity.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 07:10:55 +0000 (09:10 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 07:10:55 +0000 (09:10 +0200)
src/backupninja
src/lib/backupninja/log.py

index a77242d..1c2d71c 100755 (executable)
@@ -59,6 +59,11 @@ def make_option_parser():
                      , default="actions"
                      , dest="actions_dir"
                      , metavar="ACTIONS_DIR")
+    parser.add_option( "-d", "--debug"
+                     , help="Run in debug mode. This only means logging is "
+                            "more verbose."
+                     , action="store_true"
+                     , dest="debug")
     return parser
  
 def main(argv):
index d079c88..d9d4dfa 100644 (file)
@@ -32,5 +32,8 @@ def setup_logging(options):
     options are the parsed commandline options.
     """
     # We use the default options for now
-    logging.basicConfig(level=logging.INFO)
+    level = logging.INFO
+    if(options.debug):
+        level = logging.DEBUG
+    logging.basicConfig(level=level)
     log.debug("Initialized logging configuration")