Module: Trifle::Logger
- Defined in:
- lib/trifle/logger.rb,
lib/trifle/logger/version.rb,
lib/trifle/logger/tracer/hash.rb,
lib/trifle/logger/tracer/null.rb,
lib/trifle/logger/configuration.rb,
lib/trifle/logger/middleware/rack.rb,
lib/trifle/logger/middleware/sidekiq.rb,
lib/trifle/logger/middleware/rails_controller.rb
Defined Under Namespace
Modules: Middleware, Tracer
Classes: Configuration, Error
Constant Summary
collapse
- VERSION =
'0.4.1'
Class Method Summary
collapse
Class Method Details
.artifact(name, path) ⇒ Object
48
49
50
51
52
|
# File 'lib/trifle/logger.rb', line 48
def self.artifact(name, path)
return unless tracer
tracer.artifact(name, path)
end
|
20
21
22
23
24
|
# File 'lib/trifle/logger.rb', line 20
def self.configure
yield(default)
default
end
|
.default ⇒ Object
16
17
18
|
# File 'lib/trifle/logger.rb', line 16
def self.default
@default ||= Configuration.new
end
|
.fail! ⇒ Object
54
55
56
57
58
|
# File 'lib/trifle/logger.rb', line 54
def self.fail!
return unless tracer
tracer.fail!
end
|
.ignore! ⇒ Object
66
67
68
69
70
|
# File 'lib/trifle/logger.rb', line 66
def self.ignore!
return unless tracer
tracer.ignore!
end
|
.tag(tag) ⇒ Object
42
43
44
45
46
|
# File 'lib/trifle/logger.rb', line 42
def self.tag(tag)
return unless tracer
tracer.tag(tag)
end
|
.trace(*args, **keywords, &block) ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/trifle/logger.rb', line 34
def self.trace(*args, **keywords, &block)
if tracer.nil?
return block_given? ? yield : nil
end
tracer.trace(*args, **keywords, &block)
end
|
.tracer ⇒ Object
30
31
32
|
# File 'lib/trifle/logger.rb', line 30
def self.tracer
Thread.current[:trifle_tracer]
end
|
.tracer=(tracer) ⇒ Object
26
27
28
|
# File 'lib/trifle/logger.rb', line 26
def self.tracer=(tracer)
Thread.current[:trifle_tracer] = tracer
end
|
.warn! ⇒ Object
60
61
62
63
64
|
# File 'lib/trifle/logger.rb', line 60
def self.warn!
return unless tracer
tracer.warn!
end
|