Module: RQ::Logging::LogMethods

Included in:
RQ::Logging
Defined in:
lib/rq/logging.rb

Overview

implementations of the methods shared by both classes and objects of classes which include Logging

Instance Method Summary collapse

Instance Method Details

#debug(*args, &block) ⇒ Object

–}}}



54
# File 'lib/rq/logging.rb', line 54

def debug(*args, &block); logger.debug(*args, &block); end

#error(*args, &block) ⇒ Object



57
# File 'lib/rq/logging.rb', line 57

def error(*args, &block); logger.error(*args, &block); end

#fatal(*args, &block) ⇒ Object



58
# File 'lib/rq/logging.rb', line 58

def fatal(*args, &block); logger.fatal(*args, &block); end

#info(*args, &block) ⇒ Object



55
# File 'lib/rq/logging.rb', line 55

def info(*args, &block);  logger.info(*args, &block) ; end

#logerr(e) ⇒ Object



59
60
61
62
63
64
65
66
67
# File 'lib/rq/logging.rb', line 59

def logerr e
#--{{{
  if logger.debug?
    error{ Util::errmsg e } 
  else
    error{ Util::emsg e } 
  end
#--}}}
end

#loggerObject

–{{{



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rq/logging.rb', line 31

def logger
#--{{{
  if defined?(@logger) and @logger
    @logger
  else
    if Class === self
      @logger = self.default_logger
    else
      @logger = self::class::logger
    end
    raise "@logger is undefined!" unless defined?(@logger) and @logger
    @logger
  end
#--}}}
end

#logger=(log) ⇒ Object

–}}}



46
47
48
49
50
51
52
53
# File 'lib/rq/logging.rb', line 46

def logger= log
#--{{{
  @logger = log
  @logger.extend LoggerExt
  @logger.logdev.dev.sync = true
  @logger
#--}}}
end

#warn(*args, &block) ⇒ Object



56
# File 'lib/rq/logging.rb', line 56

def warn(*args, &block);  logger.warn(*args, &block) ; end