<commit_before><?php

//MODULE Logs (logs errors/accesses)

class Logs
{
    public static $ERRORS_FILE, $ACCESSES_FILE;

    //called on load
    public static function init() { 
        self::$ERRORS_FILE   = __DIR__."/../logs/errors.log";
        self::$ACCESSES_FILE = __DIR__."/../logs/accesses.log";
    }

    //logs error
    public static function Error($msg, $isServerError = TRUE)
     { self::AppendWithTime(self::$ERRORS_FILE, Auth::username(), (($isServerError) ? "SERVER" : "CLIENT")." ERROR: ".$msg); }

    //logs access
    public static function Login($user, $ok = TRUE) 
    { self::AppendWithTime(self::$ACCESSES_FILE, $user, "LOGIN ".(($ok) ? "OK" : "FAIL")); }

    //logs generic string 
    static function AppendWithTime($file, $user, $msg) { self::Append($file, date('Y-m-d H:i:s')." user: '$user' \t\t message: $msg"); }<commit_msg>Add newline in logs<commit_after><?php

//MODULE Logs (logs errors/accesses)

class Logs
{
    public static $ERRORS_FILE, $ACCESSES_FILE;

    //called on load
    public static function init() { 
        self::$ERRORS_FILE   = __DIR__."/../logs/errors.log";
        self::$ACCESSES_FILE = __DIR__."/../logs/accesses.log";
    }

    //logs error
    public static function Error($msg, $isServerError = TRUE)
     { self::AppendWithTime(self::$ERRORS_FILE, Auth::username(), (($isServerError) ? "SERVER" : "CLIENT")." ERROR: ".$msg."\n"); }

    //logs access
    public static function Login($user, $ok = TRUE) 
    { self::AppendWithTime(self::$ACCESSES_FILE, $user, "LOGIN ".(($ok) ? "OK" : "FAIL")); }

    //logs generic string 
    static function AppendWithTime($file, $user, $msg) { self::Append($file, date('Y-m-d H:i:s')." user: '$user' \t\t message: $msg\n"); }
{'fraction_non_alphanumeric': 0.18984420080784767, 'fraction_numerical': 0.0, 'mean_word_length': 3.4347826086956523, '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': '6839376', 'n_tokens_mistral': 600, 'n_tokens_neox': 587, 'n_words': 137}