summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-09 21:15:38 +0000
committerlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-09 21:15:38 +0000
commit7f7b5c679ff4957dcd94b4652033b9fad871cad2 (patch)
tree2e2c928b369ae7d2047c3b2ff3014e1bfbec2538
parentb13b5edba1f8e1834b15e5b7244869afe814da93 (diff)
downloadpuppet-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
-rwxr-xr-xbin/puppetd3
-rwxr-xr-xbin/puppetmasterd2
-rwxr-xr-xext/module_puppet21
3 files changed, 11 insertions, 15 deletions
diff --git a/bin/puppetd b/bin/puppetd
index 742786c8b..b6cb2535a 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -142,11 +142,9 @@ begin
when "--verbose"
Puppet::Log.level = :info
Puppet::Log.newdestination(:console)
- setdest = true
when "--debug"
Puppet::Log.level = :debug
Puppet::Log.newdestination(:console)
- setdest = true
when "--fqdn"
fqdn = arg
when "--onetime"
@@ -156,6 +154,7 @@ begin
when "--logdest"
begin
Puppet::Log.newdestination(arg)
+ setdest = true
rescue => detail
$stderr.puts detail.to_s
end
diff --git a/bin/puppetmasterd b/bin/puppetmasterd
index e0f7da25f..1f27ca70a 100755
--- a/bin/puppetmasterd
+++ b/bin/puppetmasterd
@@ -113,7 +113,6 @@ begin
when "--debug"
Puppet::Log.level = :debug
Puppet::Log.newdestination(:console)
- setdest = true
when "--help"
if $haveusage
RDoc::usage && exit
@@ -138,7 +137,6 @@ begin
puts "%s" % Puppet.version
exit
when "--verbose"
- setdest = true
Puppet::Log.level = :info
Puppet::Log.newdestination :console
else
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")