Module: FiniteMachine::Logger
- Defined in:
- lib/finite_machine/logger.rb
Class Method Summary collapse
- .debug(message) ⇒ Object
- .error(message) ⇒ Object
- .format_error(error) ⇒ Object
- .info(message) ⇒ Object
- .report_transition(name, from, to, *args) ⇒ Object
- .warn(message) ⇒ Object
Class Method Details
.debug(message) ⇒ Object
7 8 9 |
# File 'lib/finite_machine/logger.rb', line 7 def debug() FiniteMachine.logger.debug() end |
.error(message) ⇒ Object
19 20 21 |
# File 'lib/finite_machine/logger.rb', line 19 def error() FiniteMachine.logger.error() end |
.format_error(error) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/finite_machine/logger.rb', line 23 def format_error(error) = ["#{error.class}: #{error.}\n\t"] if error.backtrace << "occured at #{error.backtrace.join("\n\t")}" else << "EMPTY BACKTRACE\n\t" end .join end |
.info(message) ⇒ Object
11 12 13 |
# File 'lib/finite_machine/logger.rb', line 11 def info() FiniteMachine.logger.info() end |
.report_transition(name, from, to, *args) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/finite_machine/logger.rb', line 33 def report_transition(name, from, to, *args) = ["Transition: @event=#{name} "] unless args.empty? << "@with=[#{args.join(',')}] " end << "#{from} -> #{to}" info(.join) end |
.warn(message) ⇒ Object
15 16 17 |
# File 'lib/finite_machine/logger.rb', line 15 def warn() FiniteMachine.logger.warn() end |