<commit_before>module Telemetry
  module Logger
    extend self

    def build(subject, implementation=nil)
      implementation ||= Defaults.implementation
      logger = implementation.build(subject)
      logger
    end

    def get(subject, implementation=nil)
      logger = Logger.build self
      logger.obsolete "The \"get\" method is obsolete. It is replaced with the \"build\" method"

      build(subject, implementation=nil)
    end

    def register(subject, implementation=nil)
      logger = Logger.build self
      logger.obsolete "The \"register\" method is obsolete. It is replaced with the \"build\" method"

      build(subject, implementation=nil)
    end

    def configure(receiver, implementation=nil)
      logger = get(receiver, implementation)
      receiver.logger = logger
      logger
    end

    def self.debug(message)
      write message
    end

    def self.write(message, level=nil, subject=nil, implementation=nil)
      level ||= :debug
      subject ||= '***'

      logger = get subject, implementation

      logger.write_message level, message
    end

    module Defaults
      def self.implementation
        ConsoleLogger
      end
    end
  end
end
<commit_msg>Logger doesn't use the get method internally<commit_after>module Telemetry
  module Logger
    extend self

    def build(subject, implementation=nil)
      implementation ||= Defaults.implementation
      logger = implementation.build(subject)
      logger
    end

    def get(subject, implementation=nil)
      logger = Logger.build self
      logger.obsolete "The \"get\" method is obsolete (#{caller[0]}). It is replaced with the \"build\" method."

      build(subject, implementation=nil)
    end

    def register(subject, implementation=nil)
      logger = Logger.build self
      logger.obsolete "The \"register\" method is obsolete (#{caller[0]}). It is replaced with the \"build\" method."

      build(subject, implementation=nil)
    end

    def configure(receiver, implementation=nil)
      logger = get(receiver, implementation)
      receiver.logger = logger
      logger
    end

    def self.debug(message)
      write message
    end

    def self.write(message, level=nil, subject=nil, implementation=nil)
      level ||= :debug
      subject ||= '***'

      logger = build subject, implementation

      logger.write_message level, message
    end

    module Defaults
      def self.implementation
        ConsoleLogger
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08585247883917775, 'fraction_numerical': 0.0008061265618702137, 'mean_word_length': 2.732330827067669, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1857259', 'n_tokens_mistral': 664, 'n_tokens_neox': 633, 'n_words': 206}