Skip to content

Commit

Permalink
Better support for custom logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Kayser committed Jun 22, 2009
1 parent ca23c45 commit 6480a40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/new_relic/control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ def init_plugin(options={})
@settings = nil

options.each { |sym, val | self[sym.to_s] = val unless sym == :config }
@log = logger_override if logger_override
if logger_override
@log = logger_override
# Try to grab the log filename
@log_file = @log.instance_eval { @logdev.filename rescue nil }
end
init_config(options)
if agent_enabled? && !@started
setup_log unless logger_override
Expand Down Expand Up @@ -369,10 +373,6 @@ def log_path
File.expand_path(path)
end

def log_file_name
@log_file
end

# Create the concrete class for environment specific behavior:
def self.new_instance
@local_env = NewRelic::LocalEnvironment.new
Expand Down
6 changes: 0 additions & 6 deletions test/new_relic/control_test.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
require File.expand_path(File.join(File.dirname(__FILE__),'/../test_helper'))

module NewRelic
class Control
public :log_file_name
end
end

class NewRelic::ControlTest < Test::Unit::TestCase

attr_reader :c
Expand Down

0 comments on commit 6480a40

Please sign in to comment.