In Files

Parent

Log4r::NDC

See log4r/NDC.rb

Public Class Methods

check_thread_instance() click to toggle source
    # File lib/log4r/NDC.rb, line 17
17:     def self.check_thread_instance()
18:       if ( Thread.current[NDCNAME] == nil ) then
19:         Thread.current[NDCNAME] = Array.new
20:         Thread.current[NDCNAMEMAXDEPTH] = NDCDEFAULTMAXDEPTH
21:       end
22:     end
clear() click to toggle source
    # File lib/log4r/NDC.rb, line 24
24:     def self.clear()
25:       self.check_thread_instance()
26:       Thread.current[NDCNAME].clear
27:     end
clone_stack() click to toggle source
    # File lib/log4r/NDC.rb, line 29
29:     def self.clone_stack()
30:       self.check_thread_instance()
31:       return Thread.current[NDCNAME].clone
32:     end
get() click to toggle source
    # File lib/log4r/NDC.rb, line 51
51:     def self.get()
52:       self.check_thread_instance
53:       return Thread.current[NDCNAME] * " "
54:     end
get_depth() click to toggle source
    # File lib/log4r/NDC.rb, line 34
34:     def self.get_depth()
35:       self.check_thread_instance()
36:       return Thread.current[NDCNAME].length
37:     end
inherit( a_stack ) click to toggle source
    # File lib/log4r/NDC.rb, line 39
39:     def self.inherit( a_stack )
40:       if ( a_stack.class == Array ) then
41:         if ( Thread.current[NDCNAME] != nil ) then
42:           Thread.current[NDCNAME].clear
43:           Thread.current[NDCNAME] = nil
44:         end
45:         Thread.current[NDCNAME] = a_stack
46:       else
47:         raise "Expecting Array in NDC.inherit"
48:       end
49:     end
peek() click to toggle source
    # File lib/log4r/NDC.rb, line 56
56:     def self.peek()
57:       self.check_thread_instance()
58:       return Thread.current[NDCNAME].last
59:     end
pop() click to toggle source
    # File lib/log4r/NDC.rb, line 61
61:     def self.pop()
62:       self.check_thread_instance()
63:       return Thread.current[NDCNAME].pop
64:     end
push( value ) click to toggle source
    # File lib/log4r/NDC.rb, line 66
66:     def self.push( value )
67:       self.check_thread_instance()
68:       if ( Thread.current[NDCNAME].length < Thread.current[NDCNAMEMAXDEPTH] ) then
69:         Thread.current[NDCNAME].push( value )
70:       end
71:     end
remove() click to toggle source
    # File lib/log4r/NDC.rb, line 73
73:     def self.remove()
74:       self.check_thread_instance()
75:       Thread.current[NDCNAME].clear
76:       Thread.current[NDCNAMEMAXDEPTH] = nil
77:       Thread.current[NDCNAME] = nil
78:     end
set_max_depth( max_depth ) click to toggle source
    # File lib/log4r/NDC.rb, line 80
80:     def self.set_max_depth( max_depth )
81:       self.check_thread_instance()
82:       Thread.current[NDCNAMEMAXDEPTH] = max_depth
83:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.