Class: DohLogger::Proxy
- Defined in:
- lib/doh/logger/util.rb,
lib/doh/logger/proxy.rb
Instance Method Summary collapse
- #debug(msg) ⇒ Object
- #debug_options(shortname = 'd', longname = 'debug') ⇒ Object
- #disable_stdout ⇒ Object
- #enable_stdout ⇒ Object
- #error(msg, excpt = nil) ⇒ Object
- #fatal(msg, excpt = nil) ⇒ Object
- #info(msg) ⇒ Object
-
#initialize(location) ⇒ Proxy
constructor
A new instance of Proxy.
- #literal ⇒ Object
- #notify(msg) ⇒ Object
- #warn(msg) ⇒ Object
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 (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_stdout ⇒ Object
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_stdout ⇒ Object
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 |
#literal ⇒ Object
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 |