Class: DohLogger::Proxy

Inherits:
Object show all
Defined in:
lib/doh/logger/util.rb,
lib/doh/logger/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ Proxy

Returns a new instance of Proxy.



6
7
8
# File 'lib/doh/logger/proxy.rb', line 6

def initialize(location)
  @location = location
end

Instance Method Details

#debug(msg) ⇒ Object



30
31
32
# File 'lib/doh/logger/proxy.rb', line 30

def debug(msg)
  Doh::log.debug(msg, @location)
end

#debug_options(shortname = 'd', longname = 'debug') ⇒ Object



8
9
10
11
12
# File 'lib/doh/logger/util.rb', line 8

def debug_options(shortname = 'd', longname = 'debug')
  #note -- in order to use this right now you have to include these debug_options in your options hash, and then include a line like this:
  #dohlog.disable_stdout unless OPTS.debug
  {'debug' => [nil, "-#{shortname}", "--#{longname}", 'if specified, will display console debugging instead of just going to the file']}
end

#disable_stdoutObject



13
14
15
16
17
# File 'lib/doh/logger/util.rb', line 13

def disable_stdout
  Doh::log.disable_acceptors do |acceptor|
    acceptor[1].ios == STDOUT
  end
end

#enable_stdoutObject



18
19
20
21
22
# File 'lib/doh/logger/util.rb', line 18

def enable_stdout
  Doh::log.enable_acceptors do |acceptor|
    acceptor[1].ios == STDOUT
  end
end

#error(msg, excpt = nil) ⇒ Object



14
15
16
# File 'lib/doh/logger/proxy.rb', line 14

def error(msg, excpt = nil)
  Doh::log.error(msg, excpt, @location)
end

#fatal(msg, excpt = nil) ⇒ Object



10
11
12
# File 'lib/doh/logger/proxy.rb', line 10

def fatal(msg, excpt = nil)
  Doh::log.fatal(msg, excpt, @location)
end

#info(msg) ⇒ Object



26
27
28
# File 'lib/doh/logger/proxy.rb', line 26

def info(msg)
  Doh::log.info(msg, @location)
end

#literalObject



34
35
36
37
38
# File 'lib/doh/logger/proxy.rb', line 34

def literal
  Doh::log.literal = true
  yield
  Doh::log.literal = false
end

#notify(msg) ⇒ Object



18
19
20
# File 'lib/doh/logger/proxy.rb', line 18

def notify(msg)
  Doh::log.notify(msg, @location)
end

#warn(msg) ⇒ Object



22
23
24
# File 'lib/doh/logger/proxy.rb', line 22

def warn(msg)
  Doh::log.warn(msg, @location)
end