# frozen_string_literal: true module BingAdsRubySdk class LogMessage def initialize(message) @message = message end def to_s return message unless message_is_xml return message unless filters.any? || pretty_print document = Nokogiri::XML(message) document = apply_filter(document) if filters.any? document.to_xml(nokogiri_options) end FILTERED = "***FILTERED***" private attr_reader :message def message_is_xml message =~ /^