Sha256: 196a28264924768754ebd1849c74eb951db7178c0a4069db33fbcf269a6ab806

Contents?: true

Size: 529 Bytes

Versions: 3

Compression:

Stored size: 529 Bytes

Contents

require 'slf4r/logger'
begin
  # make sure we have java
  require 'java'
  begin
    # make sure we have SLF4J in the classloader
    import 'org.slf4j.LoggerFactory'
    org.slf4j.LoggerFactory.getLogger("root")
  
    require 'slf4r/java_logger'
    puts "using slf4j logger"
  rescue NameError
    puts "no SLF4J found in classloader - using ruby logger"
    require 'slf4r/ruby_logger'
  end
rescue LoadError
  puts "using ruby logger"
  require 'slf4r/ruby_logger'
end
if defined?(Rails)
  require 'slf4r/slf4r_railtie'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slf4r-0.4.2 lib/slf4r/init_slf4j.rb
slf4r-0.4.1 lib/slf4r/init_slf4j.rb
slf4r-0.4.0 lib/slf4r/init_slf4j.rb