<commit_before>require "logger"

module Gemstash
  #:nodoc:
  module Logging
    def log
      Gemstash::Logging.logger
    end

    def self.setup_logger(logfile)
      @logging_sink = LoggingSink.new(logfile)
    end

    def self.logger
      return @logging_sink.logger if @logging_sink
      Logger.new($stdout)
    end

    def self.raw_logger
      return @logging_sink.raw_logger if @logging_sink
      $stdout
    end

    def self.reset
      @logging_sink.close if @logging_sink
      @loggingasink = nil
    end

    #:nodoc:
    module LoggerMixin
      def log_device
        @logdev
      end
    end

    #:nodoc:
    module IOCompatible<commit_msg>Fix typo in var name<commit_after>require "logger"

module Gemstash
  #:nodoc:
  module Logging
    def log
      Gemstash::Logging.logger
    end

    def self.setup_logger(logfile)
      @logging_sink = LoggingSink.new(logfile)
    end

    def self.logger
      return @logging_sink.logger if @logging_sink
      Logger.new($stdout)
    end

    def self.raw_logger
      return @logging_sink.raw_logger if @logging_sink
      $stdout
    end

    def self.reset
      @logging_sink.close if @logging_sink
      @logging_sink = nil
    end

    #:nodoc:
    module LoggerMixin
      def log_device
        @logdev
      end
    end

    #:nodoc:
    module IOCompatible
{'fraction_non_alphanumeric': 0.06731488406881077, 'fraction_numerical': 0.0, 'mean_word_length': 2.2874692874692877, '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': '3183795', 'n_tokens_mistral': 459, 'n_tokens_neox': 444, 'n_words': 105}