Class: Guider::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/guider/logger.rb

Class Method Summary collapse

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