Class: FPM::Fry::Channel
- Inherits:
-
Cabin::Channel
- Object
- Cabin::Channel
- FPM::Fry::Channel
- Includes:
- Hint
- Defined in:
- lib/fpm/fry/channel.rb
Overview
A Cabin::Channel with two additional features:
-
There is a new log level ‘hint’ which can point users to improvements.
-
Logging an Exception that responds to #data will merge in the data from this exception. This is used together with WithData
Defined Under Namespace
Modules: Hint
Instance Method Summary collapse
Methods included from Hint
Instance Method Details
#_log(message, data = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fpm/fry/channel.rb', line 36 def _log(, data={}) case when Hash data.merge!() when Exception # message is an exception data[:message] = .to_s data[:exception] = data[:backtrace] = .backtrace if .respond_to? :data data = .data.merge(data) end else data = { :message => }.merge(data) end publish(data) end |