Module: UnionStationHooks::Log
- Defined in:
- lib/union_station_hooks_core/log.rb
Overview
Provides methods for ‘union_station_*` gems to log internal warnings and debugging messages. This module is not to be used by application developers for the purpose of logging information to Union Station.
Constant Summary collapse
- @@debugging =
false
- @@warn_callback =
nil
- @@debug_callback =
nil
Class Method Summary collapse
- .debug(message) ⇒ Object
- .debug_callback=(cb) ⇒ Object
- .debugging=(value) ⇒ Object
- .warn(message) ⇒ Object
- .warn_callback=(cb) ⇒ Object
Class Method Details
.debug(message) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/union_station_hooks_core/log.rb', line 48 def self.debug() if @@debugging if @@debug_callback @@debug_callback.call() else STDERR.puts("[UnionStationHooks] #{}") end end end |
.debug_callback=(cb) ⇒ Object
62 63 64 |
# File 'lib/union_station_hooks_core/log.rb', line 62 def self.debug_callback=(cb) @@debug_callback = cb end |
.debugging=(value) ⇒ Object
36 37 38 |
# File 'lib/union_station_hooks_core/log.rb', line 36 def self.debugging=(value) @@debugging = value end |
.warn(message) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/union_station_hooks_core/log.rb', line 40 def self.warn() if @@warn_callback @@warn_callback.call() else STDERR.puts("[UnionStationHooks] #{}") end end |
.warn_callback=(cb) ⇒ Object
58 59 60 |
# File 'lib/union_station_hooks_core/log.rb', line 58 def self.warn_callback=(cb) @@warn_callback = cb end |