PHP 8.2.30
Preview: LogEntry.php Size: 1.72 KB
/proc/thread-self/root/proc/thread-self/root/usr/local/lsws/add-ons/webcachemgr/src/LogEntry.php

<?php

/** *********************************************
 * LiteSpeed Web Server Cache Manager
 *
 * @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com)
 * @copyright (c) 2018-2019
 * *******************************************
 */

namespace Lsc\Wp;

class LogEntry
{

    /**
     * @var int
     */
    protected $lvl;

    /**
     * @var string
     */
    protected $msg;

    /**
     *
     * @var null|string
     */
    protected $prefix;

    /**
     *
     * @var int[]
     */
    protected $timestamp;

    /**
     *
     * @param string  $msg
     * @param int     $lvl
     */
    public function __construct( $msg, $lvl )
    {
        $this->msg = $msg;
        $this->lvl = $lvl;
        $this->timestamp = time();
    }

    /**
     *
     * @param string  $msg
     */
    public function append( $msg )
    {
        $this->msg .= $msg;
    }

    /**
     *
     * @return int
     */
    public function getLvl()
    {
        return $this->lvl;
    }

    /**
     *
     * @return string
     */
    public function getMsg()
    {
        $msg = ($this->prefix == null) ? '' : "{$this->prefix} ";

        if ( $this->msg ) {
            $msg .= $this->msg;
        }

        return $msg;
    }

    /**
     *
     * @param int  $logLvl
     * @return string
     * @throws LSCMException  Thrown indirectly.
     */
    public function getOutput( $logLvl )
    {
        if ( $this->lvl > $logLvl ) {
            return '';
        }


        $timestamp = date('Y-m-d H:i:s', $this->timestamp);
        $addTagInfo = Logger::getAdditionalTagInfo();
        $lvl = '[' . Logger::getLvlDescr($this->lvl) . ']';
        $msg = $this->getMsg();

        return "{$timestamp} {$addTagInfo} {$lvl}  {$msg}\n";
    }

}

Directory Contents

Dirs: 5 × Files: 15

Name Size Perms Modified Actions
Context DIR
- drwxrwxr-x 2026-03-12 22:37:30
Edit Download
Panel DIR
- drwxrwxr-x 2026-03-12 22:37:30
Edit Download
- drwxrwxr-x 2026-03-12 22:37:30
Edit Download
View DIR
- drwxrwxr-x 2026-03-12 22:37:30
Edit Download
WpWrapper DIR
- drwxrwxr-x 2026-03-12 22:37:30
Edit Download
1.79 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
40.77 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
9.89 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
1.72 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
17.95 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
651 B lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
56.12 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
22.58 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
865 B lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
28.72 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
18.15 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
54.41 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
4.75 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
16.81 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download
33.24 KB lrw-rw-r-- 2026-03-12 22:37:30
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).