From: Michael Tremer Date: Tue, 21 Aug 2012 18:05:55 +0000 (+0000) Subject: collectyd: Accept -d for debugging mode. Read configuration files. X-Git-Tag: 0.0.2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=618a7adefc87c7d73228a731a505a68359fe0643;p=collecty.git collectyd: Accept -d for debugging mode. Read configuration files. --- diff --git a/collectyd b/collectyd index ae0f608..a90e5de 100755 --- a/collectyd +++ b/collectyd @@ -26,12 +26,21 @@ import collecty # Parse command line options. op = optparse.OptionParser(usage="usage: %prog [options] ... ") -op.add_option("-d", "--daemon", action="store_true", default=False, - help="Run as a daemon in background.") +op.add_option("-d", "--debug", action="store_true", default=False, + help="Enable debug logging.") (options, configfiles) = op.parse_args() +# Initialize the settings for this Collecty instance. +settings = { + debug : options.debug, +} + # Initialize the application. -c = collecty.Collecty() +c = collecty.Collecty(**settings) + +# Read all configuration files. +for configfile in configfiles: + c.read_config(configfile) # Run. c.run()