PHP Class Arcanedev\LogViewer\Entities\LogEntry

Author: ARCANEDEV ([email protected])
Inheritance: implements Illuminate\Contracts\Support\Arrayable, implements Illuminate\Contracts\Support\Jsonable, implements JsonSerializabl\JsonSerializable
显示文件 Open project: ARCANEDEV/LogViewer

Public Properties

Property Type Description
$datetime Carbon\Carbon
$env string
$header string
$level string
$stack string

Public Methods

Method Description
__construct ( string $level, string $header, string $stack ) Construct the log entry instance.
hasStack ( ) : boolean Check if the entry has a stack.
icon ( ) : string Get level icon.
isSameLevel ( string $level ) : boolean Check if same log level.
jsonSerialize ( ) : array Serialize the log entry object to json data.
level ( ) : string Get translated level name with icon.
name ( ) : string Get translated level name.
stack ( ) : string Get the entry stack.
toArray ( ) : array Get the log entry as an array.
toJson ( integer $options ) : string Convert the log entry to its JSON representation.

Private Methods

Method Description
cleanHeader ( string $header ) : string Clean the entry header.
extractDatetime ( string $header ) : string Extract datetime from the header.
setDatetime ( string $datetime ) : LogEntry Set the entry date time.
setEnv ( string $env ) : self Set entry environment.
setHeader ( string $header ) : self Set the entry header.
setLevel ( string $level ) : self Set the entry level.
setStack ( string $stack ) : self Set the entry stack.

Method Details

__construct() public method

Construct the log entry instance.
public __construct ( string $level, string $header, string $stack )
$level string
$header string
$stack string

hasStack() public method

Check if the entry has a stack.
public hasStack ( ) : boolean
return boolean

icon() public method

Get level icon.
public icon ( ) : string
return string

isSameLevel() public method

Check if same log level.
public isSameLevel ( string $level ) : boolean
$level string
return boolean

jsonSerialize() public method

Serialize the log entry object to json data.
public jsonSerialize ( ) : array
return array

level() public method

Get translated level name with icon.
public level ( ) : string
return string

name() public method

Get translated level name.
public name ( ) : string
return string

stack() public method

Get the entry stack.
public stack ( ) : string
return string

toArray() public method

Get the log entry as an array.
public toArray ( ) : array
return array

toJson() public method

Convert the log entry to its JSON representation.
public toJson ( integer $options ) : string
$options integer
return string

Property Details

$datetime public_oe property

public Carbon,Carbon $datetime
return Carbon\Carbon

$env public_oe property

public string $env
return string

$header public_oe property

public string $header
return string

$level public_oe property

public string $level
return string

$stack public_oe property

public string $stack
return string