Class: Picky::Loggers::Verbose

Inherits:
Silent show all
Defined in:
lib/picky/loggers/verbose.rb

Overview

The verbose logger outputs all information.

Instance Attribute Summary

Attributes inherited from Silent

#output

Instance Method Summary collapse

Methods inherited from Silent

#adapt, #flush, #initialize, #logger_output?

Constructor Details

This class inherits a constructor from Picky::Loggers::Silent

Instance Method Details

#adapt_for_ioObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/picky/loggers/verbose.rb', line 37

def adapt_for_io
  super
  def timed_exclaim text
    output.puts "#{Time.now.strftime("%H:%M:%S")}: #{text}"
    flush
  end
  def warn text
    output.puts text
    flush
  end
  def write message
    output.write message
  end
end

#adapt_for_loggerObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/picky/loggers/verbose.rb', line 25

def adapt_for_logger
  super
  def timed_exclaim text
    output.info "#{Time.now.strftime("%H:%M:%S")}: #{text}"
  end
  def warn text
    output.warn text
  end
  def write message
    output << message
  end
end

#dump(category) ⇒ Object



17
18
19
# File 'lib/picky/loggers/verbose.rb', line 17

def dump category
  timed_exclaim %Q{  "#{category.identifier}": Dumped -> #{category.index_directory.gsub("#{Picky.root}/", '')}/#{category.name}_*.}
end

#info(text) ⇒ Object



9
10
11
# File 'lib/picky/loggers/verbose.rb', line 9

def info text
  timed_exclaim text
end

#load(category) ⇒ Object



21
22
23
# File 'lib/picky/loggers/verbose.rb', line 21

def load category
  timed_exclaim %Q{  "#{category.identifier}": Loading index from cache.}
end

#timed_exclaim(text) ⇒ Object



27
28
29
# File 'lib/picky/loggers/verbose.rb', line 27

def timed_exclaim text
  output.info "#{Time.now.strftime("%H:%M:%S")}: #{text}"
end

#tokenize(index_or_category, prepared_file) ⇒ Object



13
14
15
# File 'lib/picky/loggers/verbose.rb', line 13

def tokenize index_or_category, prepared_file
  timed_exclaim %Q{  "#{index_or_category.identifier}": Tokenized -> #{prepared_file.path.gsub("#{Picky.root}/", '')}.}
end

#warn(text) ⇒ Object



30
31
32
# File 'lib/picky/loggers/verbose.rb', line 30

def warn text
  output.warn text
end

#write(message) ⇒ Object



33
34
35
# File 'lib/picky/loggers/verbose.rb', line 33

def write message
  output << message
end