Class: Overcommit::Logger
- Inherits:
-
Object
- Object
- Overcommit::Logger
- Includes:
- Singleton
- Defined in:
- lib/overcommit/logger.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #bold(str) ⇒ Object
- #error(str) ⇒ Object
- #log(*args) ⇒ Object
- #notice(str) ⇒ Object
- #out ⇒ Object
- #partial(*args) ⇒ Object
- #success(str) ⇒ Object
- #warning(str) ⇒ Object
Instance Attribute Details
#output ⇒ Object
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 |
#out ⇒ Object
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 |