# File lib/logging/diagnostic_context.rb, line 261
  def self.clear_diagnostic_contexts( all = false )
    if all
      Thread.exclusive {
        Thread.list.each { |thread|
          thread[MappedDiagnosticContext::NAME].clear if thread[MappedDiagnosticContext::NAME]
          thread[NestedDiagnosticContext::NAME].clear if thread[NestedDiagnosticContext::NAME]
        }
      }
    else
      MappedDiagnosticContext.clear
      NestedDiagnosticContext.clear
    end

    self
  end