Class: RedminePluginKit::Debug

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine_plugin_kit/debug.rb

Class Method Summary collapse

Class Method Details

.log(message = 'running') ⇒ Object



6
7
8
9
10
# File 'lib/redmine_plugin_kit/debug.rb', line 6

def log(message = 'running')
  return if Rails.env.production?

  Rails.logger.debug { "#{Time.current.strftime '%H:%M:%S'} DEBUG [#{caller_locations(1..1).first.label}]: #{raw_msg message}" }
end

.msg(message = 'running') ⇒ Object



12
13
14
15
16
17
18
# File 'lib/redmine_plugin_kit/debug.rb', line 12

def msg(message = 'running')
  return if Rails.env.production?

  log message
  puts raw_msg(message) # rubocop: disable Rails/Output
  true
end