Class: Nicetest::Logger
- Inherits:
-
Object
- Object
- Nicetest::Logger
- Defined in:
- lib/nicetest/logger.rb
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #fatal!(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(io) ⇒ Logger
constructor
A new instance of Logger.
- #warn(message) ⇒ Object
Constructor Details
Instance Method Details
#debug(message) ⇒ Object
24 25 26 27 28 |
# File 'lib/nicetest/logger.rb', line 24 def debug() if ENV["NICETEST_DEBUG"] == "1" log("debug", , color: :blue) end end |
#error(message) ⇒ Object
16 17 18 |
# File 'lib/nicetest/logger.rb', line 16 def error() log("error", , color: :red) end |
#fatal!(message) ⇒ Object
30 31 32 33 |
# File 'lib/nicetest/logger.rb', line 30 def fatal!() error() exit(1) end |
#info(message) ⇒ Object
20 21 22 |
# File 'lib/nicetest/logger.rb', line 20 def info() log("info ", , color: :cyan) end |
#warn(message) ⇒ Object
12 13 14 |
# File 'lib/nicetest/logger.rb', line 12 def warn() log("warn ", , color: :yellow) end |