Class: BigKeeper::Logger
- Inherits:
-
Object
- Object
- BigKeeper::Logger
- Defined in:
- lib/big_keeper/util/logger.rb
Class Method Summary collapse
- .default(sentence) ⇒ Object
- .error(sentence) ⇒ Object
- .formatter_output(sentence) ⇒ Object
- .highlight(sentence) ⇒ Object
- .log_with_type(sentence, type) ⇒ Object
- .separator ⇒ Object
- .warning(sentence) ⇒ Object
Class Method Details
.default(sentence) ⇒ Object
21 22 23 |
# File 'lib/big_keeper/util/logger.rb', line 21 def self.default(sentence) puts formatter_output(sentence).colorize(:default) end |
.error(sentence) ⇒ Object
29 30 31 32 33 |
# File 'lib/big_keeper/util/logger.rb', line 29 def self.error(sentence) is_need_log = LeanCloudLogger.instance.is_need_log LeanCloudLogger.instance.end_log(false, is_need_log) raise formatter_output(sentence).colorize(:red) end |
.formatter_output(sentence) ⇒ Object
43 44 45 |
# File 'lib/big_keeper/util/logger.rb', line 43 def self.formatter_output(sentence) "[big] ".concat(sentence.to_s).to_s end |
.highlight(sentence) ⇒ Object
25 26 27 |
# File 'lib/big_keeper/util/logger.rb', line 25 def self.highlight(sentence) puts formatter_output(sentence).colorize(:green) end |
.log_with_type(sentence, type) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/big_keeper/util/logger.rb', line 12 def self.log_with_type(sentence,type) case type when DEFAULT_LOG then puts sentence.to_s.colorize(:default) when HIGHLIGHT_LOG then puts sentence.to_s.colorize(:green) when ERROR_LOG then raise sentence.to_s.colorize(:red) when WARNING_LOG then puts sentence.to_s.colorize(:yellow) end end |
.separator ⇒ Object
39 40 41 |
# File 'lib/big_keeper/util/logger.rb', line 39 def self.separator puts "- - - - - - - - - - - - - - - - - - - - - - - - - - -".colorize(:light_blue) end |
.warning(sentence) ⇒ Object
35 36 37 |
# File 'lib/big_keeper/util/logger.rb', line 35 def self.warning(sentence) puts formatter_output(sentence).colorize(:yellow) end |