Module: ECSHelper::Logging

Included in:
Command::Base
Defined in:
lib/ecs_helper/logging.rb

Instance Method Summary collapse

Instance Method Details

#console(message) ⇒ Object



2
3
4
# File 'lib/ecs_helper/logging.rb', line 2

def console(message)
  puts message if ENV["SKIP_LOGS"] != 'true'
end

#error(message, code = 1) ⇒ Object



15
16
17
18
19
# File 'lib/ecs_helper/logging.rb', line 15

def error(message, code = 1)
  console "Error".red
  console message
  exit code
end

#log(title, message = nil, color = "light_white") ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/ecs_helper/logging.rb', line 6

def log(title, message = nil, color = "light_white")
  if message
    console title.send(color)
    console message
  else
    console title
  end
end