Module: Bootlace::Logger

Included in:
Base, Bundler, Package, Rake
Defined in:
lib/bootlace/logger.rb

Instance Method Summary collapse

Instance Method Details

#loggerObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bootlace/logger.rb', line 5

def logger
  if ENV["TEST"]
    @logger ||= ::Logger.new('/tmp/bootlace.log')
  else
    @logger ||= ::Logger.new(STDOUT)
  end

  @logger.formatter = proc do |severity, datetime, progname, msg|
    "[bootlace] #{severity}: #{msg}\n"
  end

  @logger
end