Вход Регистрация
Файл: concrete5.7.5.6/concrete/src/Logging/LogEntry.php
Строк: 78
<?php
namespace ConcreteCoreLogging;

use 
Database;
use 
User;
use 
Core;

class 
LogEntry
{

    public function 
getLevel()
    {
        return 
$this->level;
    }

    public function 
getLevelName()
    {
        return 
Logger::getLevelName($this->level);
    }

    public function 
getLevelDisplayName()
    {
        return 
Logger::getLevelDisplayName($this->level);
    }

    public function 
getMessage()
    {
        return 
$this->message;
    }

    public function 
getChannel()
    {
        return 
$this->channel;
    }

    public function 
getChannelDisplayName()
    {
        return 
Logger::getChannelDisplayName($this->channel);
    }

    public function 
getID()
    {
        return 
$this->logID;
    }

    public function 
getLevelIcon()
    {
        switch (
$this->getLevel()) {
            case 
Logger::EMERGENCY:
                return 
'<i class="text-danger fa fa-fire launch-tooltip" title="' $this->getLevelDisplayName() . '"></i>';
            case 
Logger::CRITICAL:
            case 
Logger::ALERT:
                return 
'<i class="text-danger fa fa-exclamation-sign launch-tooltip" title="' $this->getLevelDisplayName() . '"></i>';
            case 
Logger::ERROR:
            case 
Logger::WARNING:
                return 
'<i class="text-warning fa fa-warning launch-tooltip" title="' $this->getLevelDisplayName() . '"></i>';
            case 
Logger::INFO:
                return 
'<i class="text-info fa fa-info-circle launch-tooltip" title="' $this->getLevelDisplayName() . '"></i>';
            case 
Logger::DEBUG:
                return 
'<i class="text-info fa fa-cog launch-tooltip" title="' $this->getLevelDisplayName() . '"></i>';
        }
    }

    public function 
getUserID()
    {
        return 
$this->uID;
    }

    public function 
getUserObject()
    {
        if (
$this->getUserID()) {
            
$u User::getByUserID($this->getUserID());
            if (
is_object($u)) {
                return 
$u;
            }
        }
    }

    public function 
getDisplayTimestamp()
    {
        
$dh Core::make('helper/date'); /* @var $dh ConcreteCoreLocalizationServiceDate */

        
return $dh->formatDateTime($this->timetruetrue);
    }

    public function 
getTimestamp()
    {
        return 
$this->time;
    }

    public static function 
getByID($logID)
    {
        
$db Database::get();
        
$r $db->Execute("select * from Logs where logID = ?", array($logID));
        if (
$r) {
            
$row $r->FetchRow();
            
$obj = new static();
            
$obj array_to_object($obj$row);

            return 
$obj;
        }
    }

}
Онлайн: 1
Реклама