src/UCRM/Plugins/Log.php
public static function write(string $message, string $eol = "\r\n"): string
    {
        $log_file =
            Plugin::dataPath().
            DIRECTORY_SEPARATOR."plugin.log";

        if(!file_exists(dirname($log_file)))
            mkdir(dirname($log_file));

        $line = sprintf(
            "[%s] %s",
            //(new DateTimeImmutable())->format("Y-m-d G:i:s.u"),
            (new \DateTime())->format(self::TIMESTAMP_FORMAT),
            $message
        );

        file_put_contents(
            $log_file,
            $line.$eol,
            FILE_APPEND | LOCK_EX
        );

        return $line;
    }
public static function write(string $message, string $eol = "\r\n"): string
    {
        $log_file =
            Plugin::dataPath().
            DIRECTORY_SEPARATOR."plugin.log";

        if(!file_exists(dirname($log_file)))
            mkdir(dirname($log_file));

        $line = sprintf(
            "[%s] %s",
            //(new DateTimeImmutable())->format("Y-m-d G:i:s.u"),
            (new \DateTime())->format(self::TIMESTAMP_FORMAT),
            $message
        );

        file_put_contents(
            $log_file,
            $line.$eol,
            FILE_APPEND | LOCK_EX
        );

        return $line;
    }
public static function write ( string $ message , string $ eol = "\r\n" ) : string { $ log_file = Plugin :: dataPath ( ) . DIRECTORY_SEPARATOR . "plugin.log" ; if ( ! file_exists ( dirname ( $ log_file ) ) ) mkdir ( dirname ( $ log_file ) ) ; $ line = sprintf ( "[%s] %s" , //(new DateTimeImmutable())->format("Y-m-d G:i:s.u"), ( new \ DateTime ( ) ) -> format ( self :: TIMESTAMP_FORMAT ) , $ message ) ; file_put_contents ( $ log_file , $ line . $ eol , FILE_APPEND | LOCK_EX ) ; return $ line ; }
Writes a message to this Plugin's log file.

@param string $message The message to be appended to this Plugin's log file.
@param string $eol
@return string Returns the same message that was logged.
Writes a message to this Plugin s log file .