Class: BigKeeper::Logger

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

Class Method Summary collapse

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
# File 'lib/big_keeper/util/logger.rb', line 29

def self.error(sentence)
  LeanCloudLogger.instance.end_log(false)
  raise formatter_output(sentence).colorize(:red)
end

.formatter_output(sentence) ⇒ Object



42
43
44
# File 'lib/big_keeper/util/logger.rb', line 42

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

.separatorObject



38
39
40
# File 'lib/big_keeper/util/logger.rb', line 38

def self.separator
  puts "- - - - - - - - - - - - - - - - - - - - - - - - - - -".colorize(:light_blue)
end

.warning(sentence) ⇒ Object



34
35
36
# File 'lib/big_keeper/util/logger.rb', line 34

def self.warning(sentence)
  puts formatter_output(sentence).colorize(:yellow)
end