<commit_before><?php

class Console {
    private static $startedAt = null;
    private static $last;

    /**
     * Logs the given arguments to stderr.
     * Usage: debug($var1, $anArray, ...)
     */
    public static function debug() {
        $message = 'DEBUG:';
        foreach (func_get_args() as $arg) {
            $message .= ' '.var_export($arg, true);
        }
        error_log($message);
    }

    /**
     * Logs the number of milliseconds till this named point.
     */
    public static function profile($point) {
        if(ini_get('display_errors') !== 'on') {
            return;
        }

        $now = microtime(true);
        if(self::$startedAt === null) {
            self::$startedAt = $now;
            self::$last = $now;
        }

        $totalMillis = ($now - self::$startedAt) * 1000;
        $passedMillis = ($now - self::$last) * 1000;
        error_log(sprintf('%dms (%dms) till %s',
            $totalMillis, $passedMillis, $point));
        self::$last = $now;
    }
}<commit_msg>i#1744 disabled the profilling by default.<commit_after><?php

class Console {
    private static $startedAt = null;
    private static $last;
    private static $profilingEnabled = false;

    /**
     * Logs the given arguments to stderr.
     * Usage: debug($var1, $anArray, ...)
     */
    public static function debug() {
        $message = 'DEBUG:';
        foreach (func_get_args() as $arg) {
            $message .= ' '.var_export($arg, true);
        }
        error_log($message);
    }

    /**
     * Logs the number of milliseconds till this named point.
     */
    public static function profile($point) {
        if(!self::$profilingEnabled || ini_get('display_errors') !== 'on') {
            return;
        }

        $now = microtime(true);
        if(self::$startedAt === null) {
            self::$startedAt = $now;
            self::$last = $now;
        }

        $totalMillis = ($now - self::$startedAt) * 1000;
        $passedMillis = ($now - self::$last) * 1000;
        error_log(sprintf('%dms (%dms) till %s',
            $totalMillis, $passedMillis, $point));
        self::$last = $now;
    }
}
{'fraction_non_alphanumeric': 0.15481171548117154, 'fraction_numerical': 0.010227801022780102, 'mean_word_length': 2.0140056022408963, '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': '2603069', 'n_tokens_mistral': 678, 'n_tokens_neox': 654, 'n_words': 158}