Module: Fluent::Logger
- Defined in:
- lib/fluent/logger.rb,
lib/fluent/logger/version.rb,
lib/fluent/logger/logger_base.rb,
lib/fluent/logger/null_logger.rb,
lib/fluent/logger/test_logger.rb,
lib/fluent/logger/text_logger.rb,
lib/fluent/logger/fluent_logger.rb,
lib/fluent/logger/console_logger.rb,
lib/fluent/logger/fluent_logger/cui.rb
Defined Under Namespace
Classes: ConsoleLogger, FluentLogger, LoggerBase, NullLogger, TestLogger, TextLogger
Constant Summary
collapse
- VERSION =
'0.5.1'
- @@default_logger =
nil
Class Method Summary
collapse
Class Method Details
.close ⇒ Object
44
45
46
47
48
49
|
# File 'lib/fluent/logger.rb', line 44
def self.close
if @@default_logger
@@default_logger.close
@@default_logger = nil
end
end
|
.default ⇒ Object
59
60
61
|
# File 'lib/fluent/logger.rb', line 59
def self.default
@@default_logger ||= ConsoleLogger.new(STDOUT)
end
|
.default=(logger) ⇒ Object
63
64
65
|
# File 'lib/fluent/logger.rb', line 63
def self.default=(logger)
@@default_logger = logger
end
|
.new(*args) ⇒ Object
30
31
32
33
34
35
36
37
|
# File 'lib/fluent/logger.rb', line 30
def self.new(*args)
if args.first.is_a?(Class) && args.first.ancestors.include?(LoggerBase)
type = args.shift
else
type = FluentLogger
end
type.new(*args)
end
|
.open(*args) ⇒ Object
39
40
41
42
|
# File 'lib/fluent/logger.rb', line 39
def self.open(*args)
close
@@default_logger = new(*args)
end
|
.post(tag, map) ⇒ Object
51
52
53
|
# File 'lib/fluent/logger.rb', line 51
def self.post(tag, map)
@@default_logger.post(tag, map)
end
|
.post_with_time(tag, map, time) ⇒ Object
55
56
57
|
# File 'lib/fluent/logger.rb', line 55
def self.post_with_time(tag, map, time)
@@default_logger.post_with_time(tag, map, time)
end
|