Module: Brightbox::Logging::MixinMethods

Defined in:
lib/bbcloud/logging.rb

Instance Method Summary collapse

Instance Method Details

#data(s) ⇒ Object



25
26
27
28
# File 'lib/bbcloud/logging.rb', line 25

def data(s)
  $stdout.write s
  $stdout.write "\n"
end

#debug(s) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/bbcloud/logging.rb', line 30

def debug(s)
  if ENV['DEBUG']
    STDERR.write "DEBUG: "
    STDERR.write s
    STDERR.write "\n"
  end
end

#error(s = '') ⇒ Object



9
10
11
12
13
# File 'lib/bbcloud/logging.rb', line 9

def error(s='')
  $stderr.write s
  $stderr.write "\n"
  $stderr.flush
end

#info(s = '') ⇒ Object



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

def info(s='')
  STDERR.write s
  STDERR.write "\n"
  STDERR.flush
end

#warn(s = '') ⇒ Object



21
22
23
# File 'lib/bbcloud/logging.rb', line 21

def warn(s='')
  info "WARN: #{s}"
end