def log(component, description, exception = nil, packet = nil, trace = nil)
      if exception.nil?
        Log.error(description)
      elsif exception.is_a?(String)
        Log.error(description, exception)
      else
        trace = (@trace_level && @trace_level[exception.class]) || trace || :trace
        Log.error(description, exception, trace)
        track(component, exception, packet) if trace != :no_trace
      end
      true
    rescue StandardError => e
      Log.error("Failed to log error", e, :trace) rescue nil
      false
    end
def log(component, description, exception = nil, packet = nil, trace = nil)
      if exception.nil?
        Log.error(description)
      elsif exception.is_a?(String)
        Log.error(description, exception)
      else
        trace = (@trace_level && @trace_level[exception.class]) || trace || :trace
        Log.error(description, exception, trace)
        track(component, exception, packet) if trace != :no_trace
      end
      true
    rescue StandardError => e
      Log.error("Failed to log error", e, :trace) rescue nil
      false
    end
Log error and optionally track in stats
 Errbit notification is left to the callback configured in the stats tracker
 Logging works even if init was never called

 @param [String, Object] component reporting error; non-string is snake-cased
 @param [String] description of failure for use in logging
 @param [Exception, String] exception to be logged and tracked in stats;
   string errors are logged but not tracked in stats
 @param [Packet, Hash, NilClass] packet associated with exception
 @param [Symbol, NilClass] trace level override unless excluded by configured
   trace levels

 @return [Boolean] true if successfully logged, otherwise false