Class: Sass::Logger::Base

Inherits:
Object
  • Object
show all
Includes:
LogLevel
Defined in:
lib/sass/logger/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_level = :debug) ⇒ Base

Returns a new instance of Base.



16
17
18
# File 'lib/sass/logger/base.rb', line 16

def initialize(log_level = :debug)
  self.log_level = log_level
end

Instance Attribute Details

#disabled

Returns the value of attribute disabled.



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

def disabled
  @disabled
end

#log_level

Returns the value of attribute log_level.



7
8
9
# File 'lib/sass/logger/base.rb', line 7

def log_level
  @log_level
end

Instance Method Details

#_log(level, message)



28
29
30
# File 'lib/sass/logger/base.rb', line 28

def _log(level, message)
  Kernel::warn(message)
end

#log(level, message)



24
25
26
# File 'lib/sass/logger/base.rb', line 24

def log(level, message)
  self._log(level, message) if logging_level?(level)
end

#logging_level?(level) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/sass/logger/base.rb', line 20

def logging_level?(level)
  !disabled && self.class.log_level?(level, log_level)
end