<commit_before>require 'inform'

module Gusteau
  module Log
    private

    def timestamp
      Time.now.strftime('%Y-%m-%dT%H:%M:%S')
    end

    def indent
      @level = (@level || 0) + 1
    end

    def unindent
      @level = (@level || 0) - 1
    end

    def prompt
      "[#{timestamp}] GUSTEAU: #{'  ' * (@level || 0)}"
    end

    def log(msg, opts={})
      info "%{prompt}#{msg}", opts.merge(:prompt => prompt)
      if block_given?
        indent
        start_time = Time.now
        yield
        self.tap {
          unindent
          Inform.info "%{prompt}DONE (in #{'%0.2f' % (Time.now - start_time)}s)", :prompt => prompt
        }
      else
        puts "\n"
      end
    end
<commit_msg>Fix broken return from log<commit_after>require 'inform'

module Gusteau
  module Log
    private

    def timestamp
      Time.now.strftime('%Y-%m-%dT%H:%M:%S')
    end

    def indent
      @level = (@level || 0) + 1
    end

    def unindent
      @level = (@level || 0) - 1
    end

    def prompt
      "[#{timestamp}] GUSTEAU: #{'  ' * (@level || 0)}"
    end

    def log(msg, opts={})
      info "%{prompt}#{msg}", opts.merge(:prompt => prompt)
      if block_given?
        indent
        start_time = Time.now
        yield.tap do
          unindent
          Inform.info "%{prompt}DONE (in #{'%0.2f' % (Time.now - start_time)}s)", :prompt => prompt
        end
      else
        puts "\n"
      end
    end

{'fraction_non_alphanumeric': 0.15191637630662022, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 1.793774319066148, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5787456', 'n_tokens_mistral': 516, 'n_tokens_neox': 487, 'n_words': 125}