Parent

Methods

BackgrounDRb::DebugMaster

Class wraps a logger object for debugging internal errors within server

Attributes

log_flag[RW]

(Not documented)

log_mode[RW]

(Not documented)

logger[RW]

(Not documented)

Public Class Methods

new(log_mode,log_flag = true) click to toggle source

(Not documented)

    # File server/lib/master_worker.rb, line 6
 6:     def initialize(log_mode,log_flag = true)
 7:       @log_mode = log_mode
 8:       @log_flag = log_flag
 9:       if @log_mode == :foreground
10:         @logger = ::Logger.new(STDOUT)
11:       else
12:         @logger = ::Logger.new("#{RAILS_HOME}/log/backgroundrb_debug_#{BDRB_CONFIG[:backgroundrb][:port]}.log")
13:       end
14:     end

Public Instance Methods

debug(data) click to toggle source

(Not documented)

    # File server/lib/master_worker.rb, line 21
21:     def debug(data)
22:       return unless @log_flag
23:       @logger.debug(data)
24:     end
info(data) click to toggle source

(Not documented)

    # File server/lib/master_worker.rb, line 16
16:     def info(data)
17:       return unless @log_flag
18:       @logger.info(data)
19:     end

secsequence

--- SEC00027

seccomment

--- ""

attributes

--- 
- name: log_flag
  rw: RW
  a_desc: ""
- name: log_mode
  rw: RW
  a_desc: ""
- name: logger
  rw: RW
  a_desc: ""

method_list

--- 
- methods: 
  - visibility: public
    aref: M000133
    name: new
    sourcecode: "    <span class=\"ruby-comment cmt\"># File server/lib/master_worker.rb, line 6</span>\n 6:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>(<span class=\"ruby-identifier\">log_mode</span>,<span class=\"ruby-identifier\">log_flag</span> = <span class=\"ruby-keyword kw\">true</span>)\n 7:       <span class=\"ruby-ivar\">@log_mode</span> = <span class=\"ruby-identifier\">log_mode</span>\n 8:       <span class=\"ruby-ivar\">@log_flag</span> = <span class=\"ruby-identifier\">log_flag</span>\n 9:       <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-ivar\">@log_mode</span> <span class=\"ruby-operator\">==</span> <span class=\"ruby-identifier\">:foreground</span>\n\
      10:         <span class=\"ruby-ivar\">@logger</span> = <span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Logger</span>.<span class=\"ruby-identifier\">new</span>(<span class=\"ruby-constant\">STDOUT</span>)\n\
      11:       <span class=\"ruby-keyword kw\">else</span>\n\
      12:         <span class=\"ruby-ivar\">@logger</span> = <span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Logger</span>.<span class=\"ruby-identifier\">new</span>(<span class=\"ruby-node\">&quot;#{RAILS_HOME}/log/backgroundrb_debug_#{BDRB_CONFIG[:backgroundrb][:port]}.log&quot;</span>)\n\
      13:       <span class=\"ruby-keyword kw\">end</span>\n\
      14:     <span class=\"ruby-keyword kw\">end</span>"
    params: (log_mode,log_flag = true)
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000135
    name: debug
    sourcecode: "    <span class=\"ruby-comment cmt\"># File server/lib/master_worker.rb, line 21</span>\n\
      21:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">debug</span>(<span class=\"ruby-identifier\">data</span>)\n\
      22:       <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-ivar\">@log_flag</span>\n\
      23:       <span class=\"ruby-ivar\">@logger</span>.<span class=\"ruby-identifier\">debug</span>(<span class=\"ruby-identifier\">data</span>)\n\
      24:     <span class=\"ruby-keyword kw\">end</span>"
    params: (data)
  - visibility: public
    aref: M000134
    name: info
    sourcecode: "    <span class=\"ruby-comment cmt\"># File server/lib/master_worker.rb, line 16</span>\n\
      16:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">info</span>(<span class=\"ruby-identifier\">data</span>)\n\
      17:       <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-ivar\">@log_flag</span>\n\
      18:       <span class=\"ruby-ivar\">@logger</span>.<span class=\"ruby-identifier\">info</span>(<span class=\"ruby-identifier\">data</span>)\n\
      19:     <span class=\"ruby-keyword kw\">end</span>"
    params: (data)
  category: Instance
  type: Public

sectitle

--- 

[Validate]

Generated with the Darkfish Rdoc Generator.