def add_to_appenders(level, message, error, &block)
      return unless message or block

      # Ensure configuration and context set - can be lost by marshalling and
      # unmarshalling the logger.
      @configuration ||= Hatchet.configuration
      @ndc ||= Hatchet::NestedDiagnosticContext.current

      msg = Message.new(ndc: @ndc.context.clone, message: message, error: error, backtrace_filters: @configuration.backtrace_filters, &block)

      @configuration.appenders.each do |appender|
        if appender.enabled?(level, @context)
          begin
            appender.add(level, @context, msg)
          rescue => e
            STDERR.puts "Failed to log message for #{@context} with appender #{appender} - #{level} - #{msg}\n"
            STDERR.puts "#{e}\n"
          end
        end
      end
      nil
    end
def add_to_appenders(level, message, error, &block)
      return unless message or block

      # Ensure configuration and context set - can be lost by marshalling and
      # unmarshalling the logger.
      @configuration ||= Hatchet.configuration
      @ndc ||= Hatchet::NestedDiagnosticContext.current

      msg = Message.new(ndc: @ndc.context.clone, message: message, error: error, backtrace_filters: @configuration.backtrace_filters, &block)

      @configuration.appenders.each do |appender|
        if appender.enabled?(level, @context)
          begin
            appender.add(level, @context, msg)
          rescue => e
            STDERR.puts "Failed to log message for #{@context} with appender #{appender} - #{level} - #{msg}\n"
            STDERR.puts "#{e}\n"
          end
        end
      end
      nil
    end
Private: Adds a message to each appender at the specified level.

 level   - The level of the message. One of, in decreasing order of
           severity:

             * fatal
             * error
             * warn
             * info
             * debug

 message - The message that will be logged by an appender when it is
           configured to log at the given level or lower.
 error   - An error which is associated with the message.
 block   - An optional block which will provide a message when invoked.


 Writes messages to STDOUT if any appender fails to complete the enabled
 check or log the message.

 Returns nothing.