Class: Rbfs::Logger
- Inherits:
-
Object
- Object
- Rbfs::Logger
- Defined in:
- lib/rbfs/logger.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #critical(msg) ⇒ Object
- #error(msg) ⇒ Object
- #info(msg) ⇒ Object
-
#initialize(config) ⇒ Logger
constructor
A new instance of Logger.
- #notice(msg) ⇒ Object
- #puts(msg) ⇒ Object
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
#config ⇒ Object (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 |