Module: LogjamAgent::SelectiveLogging

Extended by:
SelectiveLogging
Included in:
LogjamAgent, SelectiveLogging
Defined in:
lib/logjam_agent/selective_logging.rb

Instance Method Summary collapse

Instance Method Details

#logdevice_onlyObject



16
17
18
19
20
21
22
# File 'lib/logjam_agent/selective_logging.rb', line 16

def logdevice_only
  old_selector = logjam_log_selector
  self.logjam_log_selector = :logdevice_only  if selective_logging_enabled
  yield
ensure
  self.logjam_log_selector = old_selector
end

#logdevice_only?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/logjam_agent/selective_logging.rb', line 36

def logdevice_only?
  logjam_log_selector == :logdevice_only
end

#logjam_log_selectorObject



24
25
26
# File 'lib/logjam_agent/selective_logging.rb', line 24

def logjam_log_selector
  Thread.current.thread_variable_get(:logjam_log_selector)
end

#logjam_log_selector=(selector) ⇒ Object



28
29
30
# File 'lib/logjam_agent/selective_logging.rb', line 28

def logjam_log_selector=(selector)
  Thread.current.thread_variable_set(:logjam_log_selector, selector)
end

#logjam_onlyObject



8
9
10
11
12
13
14
# File 'lib/logjam_agent/selective_logging.rb', line 8

def logjam_only
  old_selector = logjam_log_selector
  self.logjam_log_selector = :logjam_only if selective_logging_enabled
  yield
ensure
  self.logjam_log_selector = old_selector
end

#logjam_only?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/logjam_agent/selective_logging.rb', line 32

def logjam_only?
  logjam_log_selector == :logjam_only
end