<commit_before>require 'thoth/rails/controller_context'
require 'thoth/rails/model'

module Thoth
  class Railtie < ::Rails::Railtie
    initializer "thoth.configure_rails_initialization" do
      Thoth.logger ||= Logger.new(Output::Json.new(File.open(::Rails.root.join(*%W[log events_#{ENV['RAILS_ENV']}.log]), 'a')))
    end
  end
end<commit_msg>Updated default logger to always flush.<commit_after>require 'thoth/rails/controller_context'
require 'thoth/rails/model'

module Thoth
  class Railtie < ::Rails::Railtie
    initializer "thoth.configure_rails_initialization" do
      Thoth.logger ||= (
        file = File.open(::Rails.root.join(*%W[log events_#{ENV['RAILS_ENV']}.log]), 'a')
        file.sync = true
        Logger.new(Output::Json.new(file))
      )
    end
  end
end
{'fraction_non_alphanumeric': 0.14777070063694267, 'fraction_numerical': 0.0, 'mean_word_length': 4.3108108108108105, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4980577', 'n_tokens_mistral': 280, 'n_tokens_neox': 269, 'n_words': 46}