<commit_before>require 'rbconfig'
require 'logger'
require 'dragonfly/version'
require 'dragonfly/core_ext/object'
require 'dragonfly/core_ext/array'
require 'dragonfly/core_ext/hash'
require 'dragonfly/app'
require 'dragonfly/image_magick/plugin'
require 'dragonfly/file_data_store'
require 'dragonfly/memory_data_store'
require 'dragonfly/model'
require 'dragonfly/middleware'

if defined?(::Rails)
  require 'dragonfly/railtie'
  require 'dragonfly/model/validations'
end

module Dragonfly
  class << self

    def app(name=nil)
      App.instance(name)
    end

    def [](name)
      App[name]
    end

    def running_on_windows?
      !!(RbConfig::CONFIG['host_os'] =~ %r!(msdos|mswin|djgpp|mingw)!)
    end

    # Logging
    def logger
      return nil if @logger.nil?
      @logger ||= Logger.new('dragonfly.log')
    end
    attr_writer :logger

    [:debug, :warn, :info].each do |method|<commit_msg>don't let nil logger blat over default dragonfly.log<commit_after>require 'rbconfig'
require 'logger'
require 'dragonfly/version'
require 'dragonfly/core_ext/object'
require 'dragonfly/core_ext/array'
require 'dragonfly/core_ext/hash'
require 'dragonfly/app'
require 'dragonfly/image_magick/plugin'
require 'dragonfly/file_data_store'
require 'dragonfly/memory_data_store'
require 'dragonfly/model'
require 'dragonfly/middleware'

if defined?(::Rails)
  require 'dragonfly/railtie'
  require 'dragonfly/model/validations'
end

module Dragonfly
  class << self

    def app(name=nil)
      App.instance(name)
    end

    def [](name)
      App[name]
    end

    def running_on_windows?
      !!(RbConfig::CONFIG['host_os'] =~ %r!(msdos|mswin|djgpp|mingw)!)
    end

    # Logging
    def logger
      @logger = Logger.new('dragonfly.log') unless instance_variable_defined?(:@logger)
      @logger
    end
    attr_writer :logger

    [:debug, :warn, :info].each do |method|
{'fraction_non_alphanumeric': 0.12142099681866383, 'fraction_numerical': 0.0, 'mean_word_length': 4.227146814404432, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3988453', 'n_tokens_mistral': 678, 'n_tokens_neox': 658, 'n_words': 135}