Class: Sapience::Subscriber
- Extended by:
- Descendants
- Defined in:
- lib/sapience/subscriber.rb
Direct Known Subclasses
Appender::Datadog, Appender::Sentry, Appender::Stream, Appender::Wrapper
Instance Attribute Summary collapse
-
#application ⇒ Object
Allow application name to be set globally or per subscriber.
-
#formatter ⇒ Object
Every logger has its own formatter.
-
#host ⇒ Object
Allow host name to be set globally or per subscriber.
Attributes inherited from Base
Instance Method Summary collapse
-
#close ⇒ Object
A subscriber should implement close if it can.
-
#default_formatter ⇒ Object
Returns [Sapience::Formatters::Default] formatter default for this subscriber.
-
#flush ⇒ Object
A subscriber should implement flush if it can.
-
#level ⇒ Object
Returns the current log level if set, otherwise it logs everything it receives.
- #name ⇒ Object
Methods included from Descendants
Methods inherited from Base
#fast_tag, #level=, #measure, #payload, #pop_tags, #push_tags, #silence, #tagged, #tags, #with_payload
Instance Attribute Details
#application ⇒ Object
Allow application name to be set globally or per subscriber
37 38 39 |
# File 'lib/sapience/subscriber.rb', line 37 def application @application || Sapience.config.application end |
#formatter ⇒ Object
Every logger has its own formatter
7 8 9 |
# File 'lib/sapience/subscriber.rb', line 7 def formatter @formatter end |
Instance Method Details
#close ⇒ Object
A subscriber should implement close if it can.
27 28 29 |
# File 'lib/sapience/subscriber.rb', line 27 def close # NOOP end |
#default_formatter ⇒ Object
Returns [Sapience::Formatters::Default] formatter default for this subscriber
32 33 34 |
# File 'lib/sapience/subscriber.rb', line 32 def default_formatter Sapience::Formatters::Default.new end |
#flush ⇒ Object
A subscriber should implement flush if it can.
18 19 20 |
# File 'lib/sapience/subscriber.rb', line 18 def flush # NOOP end |
#level ⇒ Object
Returns the current log level if set, otherwise it logs everything it receives
13 14 15 |
# File 'lib/sapience/subscriber.rb', line 13 def level @level || :trace end |
#name ⇒ Object
22 23 24 |
# File 'lib/sapience/subscriber.rb', line 22 def name self.class.name end |