summaryrefslogtreecommitdiff
path: root/lib/oxidized/hook.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-01-04 18:50:54 +0200
committerytti <saku@ytti.fi>2016-01-04 18:50:54 +0200
commit0eeba91b426c8b4a6335a88da9c65ba38e5fac15 (patch)
tree02ba46c4f7d43b5721f3eb7de38599e0e019e5cf /lib/oxidized/hook.rb
parentf112dfa0c604ae1c990f6411a002806924c00bf3 (diff)
parente41f7b429901eb38ad785ad1fc2527dd41f35959 (diff)
Merge pull request #250 from Shopify/master0.10.0
refactoring, test coverage and github hook
Diffstat (limited to 'lib/oxidized/hook.rb')
-rw-r--r--lib/oxidized/hook.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/oxidized/hook.rb b/lib/oxidized/hook.rb
index 7f1942b..029688d 100644
--- a/lib/oxidized/hook.rb
+++ b/lib/oxidized/hook.rb
@@ -46,7 +46,7 @@ class HookManager
hook.cfg = cfg
@registered_hooks[event] << RegisteredHook.new(name, hook)
- Log.debug "Hook #{name.inspect} registered #{hook.class} for event #{event.inspect}"
+ Oxidized.logger.debug "Hook #{name.inspect} registered #{hook.class} for event #{event.inspect}"
end
def handle event, ctx_params={}
@@ -57,7 +57,7 @@ class HookManager
begin
r_hook.hook.run_hook ctx
rescue => e
- Log.error "Hook #{r_hook.name} (#{r_hook.hook}) failed " +
+ Oxidized.logger.error "Hook #{r_hook.name} (#{r_hook.hook}) failed " +
"(#{e.inspect}) for event #{event.inspect}"
end
end
@@ -66,7 +66,7 @@ end
# Hook abstract base class
class Hook
- attr_accessor :cfg
+ attr_reader :cfg
def initialize
end
@@ -81,7 +81,7 @@ class Hook
end
def log(msg, level=:info)
- Log.send(level, "#{self.class.name}: #{msg}")
+ Oxidized.logger.send(level, "#{self.class.name}: #{msg}")
end
end