Class: Overcommit::Logger

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/overcommit/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#outputObject

Returns the value of attribute output.



8
9
10
# File 'lib/overcommit/logger.rb', line 8

def output
  @output
end

Instance Method Details

#bold(str) ⇒ Object



18
19
20
# File 'lib/overcommit/logger.rb', line 18

def bold(str)
  color('1;37', str)
end

#error(str) ⇒ Object



22
23
24
# File 'lib/overcommit/logger.rb', line 22

def error(str)
  color(31, str)
end

#log(*args) ⇒ Object



14
15
16
# File 'lib/overcommit/logger.rb', line 14

def log(*args)
  out.puts *args
end

#notice(str) ⇒ Object



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

def notice(str)
  color('1;33', str)
end

#outObject



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

def out
  self.output ||= $stdout
end

#partial(*args) ⇒ Object



10
11
12
# File 'lib/overcommit/logger.rb', line 10

def partial(*args)
  out.print *args
end

#success(str) ⇒ Object



26
27
28
# File 'lib/overcommit/logger.rb', line 26

def success(str)
  color(32, str)
end

#warning(str) ⇒ Object



30
31
32
# File 'lib/overcommit/logger.rb', line 30

def warning(str)
  color(33, str)
end