lib/loggr/adapter/abstract.rb in loggr-1.0.0 vs lib/loggr/adapter/abstract.rb in loggr-1.1.0

- old
+ new

@@ -1,25 +1,25 @@ module Loggr module Adapter - + # A basically abstract base class for logger backend # implementations, provides a default implementation for MDC (hash & thread local based). # # Ensure to implement `#logger`. - # + # class AbstractAdapter - + # Implement which creates a new instance of a logger. def logger(name, options = {}) raise "#{self.class.name}#logger is declared `abstract': implement #logger method" end - + # Use a simple thread local hash as fake MDC, because it's # not supported by the logger anyway - but it should be available # for consistency and usage. def mdc mdc_key = "#{self.class.name}.mdc" Thread.current[mdc_key] ||= Hash.new - end + end end end end \ No newline at end of file