Class: Sapience::Subscriber

Inherits:
Base
  • Object
show all
Defined in:
lib/sapience/subscriber.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#filter, #name

Instance Method Summary collapse

Methods inherited from Base

#fast_tag, #level=, #measure, #payload, #pop_tags, #push_tags, #silence, #tagged, #tags, #with_payload

Instance Attribute Details

#applicationObject

Allow application name to be set globally or per subscriber



31
32
33
# File 'lib/sapience/subscriber.rb', line 31

def application
  @application || Sapience.config.application
end

#formatterObject

Every logger has its own formatter



7
8
9
# File 'lib/sapience/subscriber.rb', line 7

def formatter
  @formatter
end

#hostObject

Allow host name to be set globally or per subscriber



36
37
38
# File 'lib/sapience/subscriber.rb', line 36

def host
  @host || Sapience.config.host
end

Instance Method Details

#closeObject

A subscriber should implement close if it can.



21
22
23
# File 'lib/sapience/subscriber.rb', line 21

def close
  # NOOP
end

#default_formatterObject

Returns [Sapience::Formatters::Default] formatter default for this subscriber



26
27
28
# File 'lib/sapience/subscriber.rb', line 26

def default_formatter
  Sapience::Formatters::Default.new
end

#flushObject

A subscriber should implement flush if it can.



16
17
18
# File 'lib/sapience/subscriber.rb', line 16

def flush
  # NOOP
end

#levelObject

Returns the current log level if set, otherwise it logs everything it receives



11
12
13
# File 'lib/sapience/subscriber.rb', line 11

def level
  @level || :trace
end