<commit_before>require 'pakyow/core/logger/formatters/dev_formatter'
require 'pakyow/core/logger/formatters/logfmt_formatter'

Pakyow::Config.register :logger do |config|
  # whether or not pakyow should write to a log
  config.opt :enabled, true

  # the default level to log at
  config.opt :level, :debug

  # the formatter responsible for formatting request logs
  config.opt :formatter, Pakyow::Logger::DevFormatter

  # where we should log to
  config.opt :destinations, [$stdout]
end.env :test do |opts|
  opts.destinations = []
end.env :production do |opts|
  opts.formatter = Pakyow::Logger::LogfmtFormatter
end<commit_msg>Log to /dev/null when logger is disabled<commit_after>require 'pakyow/core/logger/formatters/dev_formatter'
require 'pakyow/core/logger/formatters/logfmt_formatter'

Pakyow::Config.register :logger do |config|
  # whether or not pakyow should write to a log
  config.opt :enabled, true

  # the default level to log at
  config.opt :level, :debug

  # the formatter responsible for formatting request logs
  config.opt :formatter, Pakyow::Logger::DevFormatter

  # where we should log to
  config.opt :destinations, -> do
    if Pakyow::Config.logger.enabled
      [$stdout]
    else
      ["/dev/null"]
    end
  end
end.env :test do |opts|
  opts.destinations = []
end.env :production do |opts|
  opts.formatter = Pakyow::Logger::LogfmtFormatter
end
{'fraction_non_alphanumeric': 0.1012292118582791, 'fraction_numerical': 0.0, 'mean_word_length': 4.323076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5002217', 'n_tokens_mistral': 447, 'n_tokens_neox': 428, 'n_words': 130}