Class: ActiveSupport::Logger
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Logger
|
|
Instance Chain:
self,
::LoggerSilence,
LoggerThreadSafeLevel,
Logger
|
|
Inherits: |
Logger
|
Defined in: | activesupport/lib/active_support/logger.rb |
::LoggerSilence - Attributes & Methods
Class Method Summary
-
.logger_outputs_to?(logger, *sources) ⇒ Boolean
Returns true if the logger destination matches one of the sources.
- .new(*args) ⇒ Logger constructor
Instance Attribute Summary
LoggerThreadSafeLevel - Included
Instance Method Summary
::LoggerSilence - Included
#silence | Silences the logger for the duration of the block. |
LoggerThreadSafeLevel - Included
Constructor Details
.new(*args) ⇒ Logger
# File 'activesupport/lib/active_support/logger.rb', line 80
def initialize(*args) super @formatter = SimpleFormatter.new after_initialize if respond_to? :after_initialize end
Class Attribute Details
.silencer (rw) Also known as: #silencer
[ GitHub ]# File 'activesupport/lib/active_support/logger_silence.rb', line 8
cattr_accessor :silencer
Class Method Details
.logger_outputs_to?(logger, *sources) ⇒ Boolean
Returns true if the logger destination matches one of the sources
logger = Logger.new(STDOUT)
ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT)
# => true
# File 'activesupport/lib/active_support/logger.rb', line 16
def self.logger_outputs_to?(logger, *sources) logdev = logger.instance_variable_get("@logdev") logger_source = logdev.dev if logdev.respond_to?(:dev) sources.any? { |source| source == logger_source } end
Instance Attribute Details
#silencer (rw)
[ GitHub ]# File 'activesupport/lib/active_support/logger_silence.rb', line 8
cattr_accessor :silencer
Instance Method Details
#add(severity, message = nil, progname = nil, &block)
[ GitHub ]# File 'activesupport/lib/active_support/logger.rb', line 86
def add(severity, = nil, progname = nil, &block) return true if @logdev.nil? || (severity || UNKNOWN) < level super end