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



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

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

Instance Attribute Details

#disabled

Returns the value of attribute disabled



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

def disabled
  @disabled
end

#log_level

Returns the value of attribute log_level



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

def log_level
  @log_level
end

Instance Method Details

#_log(level, message)



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

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

#log(level, message)



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

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

#logging_level?(level) ⇒ Boolean

Returns:

  • (Boolean)


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

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