Module: Flnt
- Defined in:
- lib/flnt.rb,
lib/flnt/logger.rb,
lib/flnt/version.rb,
lib/flnt/configuration.rb,
lib/flnt/teeable_logger.rb
Defined Under Namespace
Modules: Configuration
Classes: Logger, TeeableLogger
Constant Summary
collapse
- VERSION =
"0.4.0"
Class Method Summary
collapse
Class Method Details
.initialize!(force = false) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/flnt.rb', line 31
def initialize!(force=false)
if force or ( !initialized? and !test_mode? )
@initialized = true
Fluent::Logger::FluentLogger.open(*Flnt::Configuration())
end
end
|
.initialized? ⇒ Boolean
27
28
29
|
# File 'lib/flnt.rb', line 27
def initialized?
!! @initialized
end
|
.method_missing(name, *args) ⇒ Object
21
22
23
24
25
|
# File 'lib/flnt.rb', line 21
def method_missing(name, *args)
return super if name.to_s =~ /(!|\?)$/
initialize!
Flnt::Logger.new(name.to_s)
end
|
.tag!(tag) ⇒ Object
38
39
40
41
|
# File 'lib/flnt.rb', line 38
def tag!(tag)
initialize!
Flnt::Logger.new(tag.to_s)
end
|
.test_mode! ⇒ Object
This is useful for testing
44
45
46
47
48
|
# File 'lib/flnt.rb', line 44
def test_mode!
@test_mode = true
::Fluent::Logger.open(::Fluent::Logger::TestLogger)
end
|
.test_mode? ⇒ Boolean
50
51
52
|
# File 'lib/flnt.rb', line 50
def test_mode?
@test_mode || false
end
|