diff options
| author | lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-09 21:15:38 +0000 |
|---|---|---|
| committer | lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-09 21:15:38 +0000 |
| commit | 7f7b5c679ff4957dcd94b4652033b9fad871cad2 (patch) | |
| tree | 2e2c928b369ae7d2047c3b2ff3014e1bfbec2538 /ext/module_puppet | |
| parent | b13b5edba1f8e1834b15e5b7244869afe814da93 (diff) | |
| download | puppet-7f7b5c679ff4957dcd94b4652033b9fad871cad2.tar.gz puppet-7f7b5c679ff4957dcd94b4652033b9fad871cad2.tar.xz puppet-7f7b5c679ff4957dcd94b4652033b9fad871cad2.zip | |
Change in how logging is defaulted: by default logs go to :syslog, unless the user explicitly gives at least one --logdest argument, in which case logs only go to the destinations the user gave.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@895 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'ext/module_puppet')
| -rwxr-xr-x | ext/module_puppet | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/module_puppet b/ext/module_puppet index 388b3a1c1..542b93207 100755 --- a/ext/module_puppet +++ b/ext/module_puppet @@ -83,9 +83,7 @@ master = { :Local => true } -# We default to a non-console log destination, because we assume this is being -# run non-interactively. -#Puppet[:logdest] = :console +setdest = false begin result.each { |opt,arg| @@ -103,12 +101,17 @@ begin when "--use-nodes" master[:UseNodes] = true when "--verbose" + Puppet::Log.level = :info + Puppet::Log.newdestination(:console) verbose = true when "--debug" + Puppet::Log.level = :debug + Puppet::Log.newdestination(:console) debug = true when "--logdest" begin Puppet::Log.newdestination arg + setdest=true rescue => detail $stderr.puts detail.to_s end @@ -124,14 +127,6 @@ rescue GetoptLong::InvalidOption => detail exit(1) end -if debug - Puppet::Log.level = :debug - Puppet::Log.newdestination :console -elsif verbose - Puppet::Log.level = :info - Puppet::Log.newdestination :console -end - # Now parse the config if Puppet[:config] and File.exists? Puppet[:config] Puppet.config.parse(Puppet[:config]) @@ -145,6 +140,10 @@ unless ARGV.length > 0 exit(14) end +unless setdest + Puppet::Log.newdestination(:syslog) +end + master[:File] = ARGV.shift unless ENV.include?("CFALLCLASSES") |
