From: <th...@us...> - 2011-08-15 21:50:03
|
Revision: 299 http://etch.svn.sourceforge.net/etch/?rev=299&view=rev Author: thepob Date: 2011-08-15 21:49:55 +0000 (Mon, 15 Aug 2011) Log Message: ----------- adding etchdebuglog support per user request - there was an email thread about this one Modified Paths: -------------- trunk/server/lib/etch/server.rb Modified: trunk/server/lib/etch/server.rb =================================================================== --- trunk/server/lib/etch/server.rb 2011-07-09 00:36:49 UTC (rev 298) +++ trunk/server/lib/etch/server.rb 2011-08-15 21:49:55 UTC (rev 299) @@ -24,14 +24,16 @@ end @@configbase end - + @@auth_enabled = nil @@auth_deny_new_clients = nil + @@etchdebuglog = nil def self.read_config_file config_file = File.join(configbase, 'etchserver.conf') if File.exist?(config_file) auth_enabled = false auth_deny_new_clients = false + etchdebuglog = nil IO.foreach(config_file) do |line| # Skip blank lines and comments next if line =~ /^\s*$/ @@ -47,7 +49,11 @@ auth_deny_new_clients = true end end + if line =~ /^\s*etchdebuglog\s*=\s*(.*)/ + etchdebuglog = $1 + end end + @@etchdebuglog = etchdebuglog @@auth_enabled = auth_enabled @@auth_deny_new_clients = auth_deny_new_clients end @@ -203,12 +209,19 @@ @facts = facts @tag = tag @debug = debug - @dlogger = Logger.new(File.join(Rails.configuration.root_path, 'log', 'etchdebug.log')) + + if @@etchdebuglog + @dlogger = Logger.new(@@etchdebuglog) + else + @dlogger = Logger.new(File.join(Rails.configuration.root_path, 'log', 'etchdebug.log')) + end + if debug @dlogger.level = Logger::DEBUG else @dlogger.level = Logger::INFO end + @fqdn = @facts['fqdn'] if !@fqdn This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |