Class: DebugBundle::Logging::SemanticLoggerAppender
- Inherits:
-
Object
- Object
- DebugBundle::Logging::SemanticLoggerAppender
- Defined in:
- lib/debugbundle/logging.rb
Instance Method Summary collapse
-
#initialize(client: DebugBundle.client) ⇒ SemanticLoggerAppender
constructor
A new instance of SemanticLoggerAppender.
- #log(log) ⇒ Object
Constructor Details
#initialize(client: DebugBundle.client) ⇒ SemanticLoggerAppender
Returns a new instance of SemanticLoggerAppender.
54 55 56 |
# File 'lib/debugbundle/logging.rb', line 54 def initialize(client: DebugBundle.client) @client = client end |
Instance Method Details
#log(log) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/debugbundle/logging.rb', line 58 def log(log) was_capturing = Thread.current[RECURSION_GUARD_KEY] return if was_capturing Thread.current[RECURSION_GUARD_KEY] = true @client.capture_log( log., level: log.level || :info, context: { logger_name: log.name, payload: log.payload, tags: log. } ) ensure Thread.current[RECURSION_GUARD_KEY] = was_capturing end |