Class: Rbfs::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/rbfs/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Logger

Returns a new instance of Logger.



5
6
7
# File 'lib/rbfs/logger.rb', line 5

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/rbfs/logger.rb', line 3

def config
  @config
end

Instance Method Details

#critical(msg) ⇒ Object



21
22
23
24
# File 'lib/rbfs/logger.rb', line 21

def critical(msg)
  puts "\033[0;31m#{msg}\033[00m"
  exit 1
end

#error(msg) ⇒ Object



17
18
19
# File 'lib/rbfs/logger.rb', line 17

def error(msg)
  puts "\033[0;31m#{msg}\033[00m"
end

#info(msg) ⇒ Object



9
10
11
# File 'lib/rbfs/logger.rb', line 9

def info(msg)
  puts "\033[0;32m#{msg}\033[00m"
end

#notice(msg) ⇒ Object



26
27
28
# File 'lib/rbfs/logger.rb', line 26

def notice(msg)
  puts "\033[0;33m#{msg}\033[00m"
end

#puts(msg) ⇒ Object



13
14
15
# File 'lib/rbfs/logger.rb', line 13

def puts(msg)
  $stdout.puts "#{msg}"
end