Class: Loggr::SLF4J::MarkerFactory

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

Overview

Simple marker factory which uses `org.slf4j.MarkerFactory`, but caches the result in a local ruby hash, by name.

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object

Get marker for any non-empty string.



12
13
14
15
16
17
# File 'lib/loggr/slf4j/logger.rb', line 12

def self.[](name)
  name = name.to_s.strip
  return nil if name.length == 0
  @markers ||= {}
  @markers[name] ||= Java::OrgSlf4j::MarkerFactory.getMarker(name)
end