Module: GitWorkflow::Logging::ClassMethods
- Included in:
- Callbacks::Loader
- Defined in:
- lib/git_workflow/logging.rb
Instance Method Summary collapse
Instance Method Details
#log(level, message, &block) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/git_workflow/logging.rb', line 60 def log(level, , &block) if block_given? begin logger.send(level, "(start): #{ }") rc = yield logger.send(level, "(finish): #{ }") rc rescue => exception logger.error("#{ } (#{ exception. })") raise end else logger.send(level, ) end end |
#logger ⇒ Object
56 57 58 |
# File 'lib/git_workflow/logging.rb', line 56 def logger @logger || GitWorkflow::Logging.logger end |
#logger=(logger) ⇒ Object
52 53 54 |
# File 'lib/git_workflow/logging.rb', line 52 def logger=(logger) @logger = logger end |