Class: Log4r::NDC

### Home Classes Methods

### In Files

- lib/log4r/NDC.rb

### Parent

Object

### Methods

- ::check_thread_instance
- ::clear
- ::clone_stack
- ::get
- ::get_depth
- ::inherit
- ::peek
- ::pop
- ::push
- ::remove
- ::set_max_depth

### Files

- GDC
- MDC
- NDC
- configurator
- emailoutputter
- formatter
- log4jxmlformatter
- log4r
- logger
- logserver
- outputter
- patternformatter
- scribeoutputter
- syslogoutputter
- win32eventoutputter
- yamlconfigurator

### Class/Module Index

Quicksearch

- Log4r
- Log4r::BasicFormatter
- Log4r::ConfigError
- Log4r::Configurator
- Log4r::DateFileOutputter
- Log4r::DefaultFormatter
- Log4r::EmailOutputter
- Log4r::FileOutputter
- Log4r::Formatter
- Log4r::GDC
- Log4r::IOOutputter
- Log4r::Log4jXmlFormatter
- Log4r::Log4rTools
- Log4r::LogEvent
- Log4r::LogServer
- Log4r::Logger
- Log4r::MDC
- Log4r::NDC
- Log4r::ObjectFormatter
- Log4r::Outputter
- Log4r::PatternFormatter
- Log4r::RemoteOutputter
- Log4r::RollingFileOutputter
- Log4r::RootLogger
- Log4r::ScribeOutputter
- Log4r::SimpleFormatter
- Log4r::StderrOutputter
- Log4r::StdoutOutputter
- Log4r::SyslogOutputter
- Log4r::UDPOutputter
- Log4r::YamlConfigurator
- REXML
- Object

No matching classes.

# Log4r::NDC

See log4r/NDC.rb

### Public Class Methods

check_thread_instance() click to toggle source

    # File lib/log4r/NDC.rb, line 17
    def self.check_thread_instance()
      if ( Thread.current[NDCNAME] == nil ) then
        Thread.current[NDCNAME] = Array.new
        Thread.current[NDCNAMEMAXDEPTH] = NDCDEFAULTMAXDEPTH
      end
    end

clear() click to toggle source

    # File lib/log4r/NDC.rb, line 24
    def self.clear()
      self.check_thread_instance()
      Thread.current[NDCNAME].clear
    end

clone_stack() click to toggle source

    # File lib/log4r/NDC.rb, line 29
    def self.clone_stack()
      self.check_thread_instance()
      return Thread.current[NDCNAME].clone
    end

get() click to toggle source

    # File lib/log4r/NDC.rb, line 51
    def self.get()
      self.check_thread_instance
      return Thread.current[NDCNAME] * " "
    end

get_depth() click to toggle source

    # File lib/log4r/NDC.rb, line 34
    def self.get_depth()
      self.check_thread_instance()
      return Thread.current[NDCNAME].length
    end

inherit( a_stack ) click to toggle source

    # File lib/log4r/NDC.rb, line 39
    def self.inherit( a_stack )
      if ( a_stack.class == Array ) then
        if ( Thread.current[NDCNAME] != nil ) then
          Thread.current[NDCNAME].clear
          Thread.current[NDCNAME] = nil
        end
        Thread.current[NDCNAME] = a_stack
      else
        raise "Expecting Array in NDC.inherit"
      end
    end

peek() click to toggle source

    # File lib/log4r/NDC.rb, line 56
    def self.peek()
      self.check_thread_instance()
      return Thread.current[NDCNAME].last
    end

pop() click to toggle source

    # File lib/log4r/NDC.rb, line 61
    def self.pop()
      self.check_thread_instance()
      return Thread.current[NDCNAME].pop
    end

push( value ) click to toggle source

    # File lib/log4r/NDC.rb, line 66
    def self.push( value )
      self.check_thread_instance()
      if ( Thread.current[NDCNAME].length < Thread.current[NDCNAMEMAXDEPTH] ) then
        Thread.current[NDCNAME].push( value )
      end
    end

remove() click to toggle source

    # File lib/log4r/NDC.rb, line 73
    def self.remove()
      self.check_thread_instance()
      Thread.current[NDCNAME].clear
      Thread.current[NDCNAMEMAXDEPTH] = nil
      Thread.current[NDCNAME] = nil
    end

set_max_depth( max_depth ) click to toggle source

    # File lib/log4r/NDC.rb, line 80
    def self.set_max_depth( max_depth )
      self.check_thread_instance()
      Thread.current[NDCNAMEMAXDEPTH] = max_depth
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.