Class: Guider::Logger
- Inherits:
-
Object
- Object
- Guider::Logger
- Defined in:
- lib/guider/logger.rb
Class Method Summary collapse
-
.context=(filename) ⇒ Object
Sets file context for warnings.
-
.warn(msg) ⇒ Object
Prints out a warning when warnings enabled.
-
.warnings=(enabled) ⇒ Object
Turns printing of warnings on or off.
Class Method Details
.context=(filename) ⇒ Object
Sets file context for warnings
9 10 11 |
# File 'lib/guider/logger.rb', line 9 def self.context=(filename) @context = filename end |
.warn(msg) ⇒ Object
Prints out a warning when warnings enabled.
14 15 16 17 |
# File 'lib/guider/logger.rb', line 14 def self.warn(msg) file = @context ? @context + ": " : "" $stderr.puts(file + msg) if @warnings end |
.warnings=(enabled) ⇒ Object
Turns printing of warnings on or off.
4 5 6 |
# File 'lib/guider/logger.rb', line 4 def self.warnings=(enabled) @warnings = enabled end |