Class: LogParser::Logger
- Inherits:
-
Object
- Object
- LogParser::Logger
- Defined in:
- lib/log_parser/logger.rb
Overview
A simple helper, probably to be replaced by a proper logging library at some point.
Class Method Summary collapse
-
.debug(message) ⇒ void
Logs the given message to STDOUT if ‘debug?` is true.
-
.debug=(flag) ⇒ void
Switches debugging mode on and off.
-
.debug? ⇒ true, false
Indicates whether we are debugging.
Class Method Details
permalink .debug(message) ⇒ void
This method returns an undefined value.
Logs the given message to STDOUT if ‘debug?` is true.
28 29 30 |
# File 'lib/log_parser/logger.rb', line 28 def debug() puts if debug? end |
permalink .debug=(flag) ⇒ void
This method returns an undefined value.
Switches debugging mode on and off.
12 13 14 |
# File 'lib/log_parser/logger.rb', line 12 def debug=(flag) self.debugging = flag end |
permalink .debug? ⇒ true, false
Indicates whether we are debugging.
20 21 22 |
# File 'lib/log_parser/logger.rb', line 20 def debug? debugging || !ENV['DEBUG'].nil? end |