<commit_before>require 'lightchef'
require 'logger'

module Lightchef
  module Logger
    def self.logger
      @logger ||= ::Logger.new($stdout)
    end<commit_msg>Change formatter of a logger.<commit_after>require 'lightchef'
require 'logger'

module Lightchef
  module Logger
    class Formatter
      def call(severity, datetime, progname, msg)
        "[%s] %5s : %s\n" % [format_datetime(datetime), severity, msg2str(msg)]
      end

      private
      def format_datetime(time)
        time.strftime("%Y-%m-%dT%H:%M:%S.") << "%06d" % time.usec
      end

      def msg2str(msg)
        case msg
        when ::String
          msg
        when ::Exception
          "#{ msg.message } (#{ msg.class })\n" <<
          (msg.backtrace || []).join("\n")
        else
          msg.inspect
        end
      end
    end

    def self.logger
      @logger ||= ::Logger.new($stdout).tap do |logger|
        logger.formatter = Formatter.new
      end
    end
{'fraction_non_alphanumeric': 0.1315240083507307, 'fraction_numerical': 0.005219206680584551, 'mean_word_length': 2.1546052631578947, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3064754', 'n_tokens_mistral': 311, 'n_tokens_neox': 301, 'n_words': 74}