Jeedom Core

log
in package

Table of Contents

Constants

DEFAULT_MAX_LINE  = 200

Properties

$config  : mixed
$logger  : mixed

Methods

add()  : mixed
Add message and keep it less than 1000 lines
authorizeClearLog()  : mixed
Check authorisation to emptying log file
chunk()  : mixed
chunkLog()  : mixed
clear()  : mixed
Empty log file
clearAll()  : mixed
convertLogLevel()  : mixed
define_error_reporting()  : mixed
Set php error level
exception()  : mixed
get()  : bool|array<string|int, mixed>
Get $_nbLines from a $_log from $_begin position
getConfig()  : mixed
getDelta()  : array<string|int, mixed>
Get the log delta from $_position to the end of the file New position is stored in $_position when eof is reached
getLastLine()  : string
Efficiently get the last line of a file
getLogger()  : mixed
getLogLevel()  : mixed
getPathToLog()  : mixed
liste()  : mixed
remove()  : mixed
Delete log file
removeAll()  : mixed

Constants

DEFAULT_MAX_LINE

public mixed DEFAULT_MAX_LINE = 200

Properties

$config

private static mixed $config = \null

$logger

private static mixed $logger = array()

Methods

add()

Add message and keep it less than 1000 lines

public static add(mixed $_log, string $_type, string $_message[, mixed $_logicalId = '' ]) : mixed
Parameters
$_log : mixed
$_type : string

message type (info, debug, warning, danger)

$_message : string

message added into log

$_logicalId : mixed = ''

authorizeClearLog()

Check authorisation to emptying log file

public static authorizeClearLog(mixed $_log[, mixed $_subPath = '' ]) : mixed
Parameters
$_log : mixed
$_subPath : mixed = ''

chunk()

public static chunk([mixed $_log = '' ]) : mixed
Parameters
$_log : mixed = ''

chunkLog()

public static chunkLog(mixed $_path) : mixed
Parameters
$_path : mixed

clear()

Empty log file

public static clear(mixed $_log) : mixed
Parameters
$_log : mixed

clearAll()

public static clearAll() : mixed

convertLogLevel()

public static convertLogLevel([mixed $_level = 100 ]) : mixed
Parameters
$_level : mixed = 100

define_error_reporting()

Set php error level

public static define_error_reporting(int $log_level) : mixed
Parameters
$log_level : int
Tags
since
2.1.4
author

KwiZeR kwizer@kw12er.com

exception()

public static exception(mixed $e) : mixed
Parameters
$e : mixed

get()

Get $_nbLines from a $_log from $_begin position

public static get(string $_log, int $_begin, int $_nbLines) : bool|array<string|int, mixed>
Parameters
$_log : string
$_begin : int
$_nbLines : int
Tags
deprecated

v4.4 => removed in v4.6 (use log::getDelta() instead)

Note that log::get($_log, $_begin, $_nbLines) is equivalent to: $path = (!file_exists($_log) || !is_file($_log)) ? self::getPathToLog($_log) : $_log; if (!file_exists($path)) { return false; } $delta = self::getDelta($_log, $_begin, '', false, false, 0, $_nbLines); $arr = explode("\n", $delta['logText']); unset($arr[count($arr) - 1]); $res = array_reverse($arr);

Return values
bool|array<string|int, mixed>

getConfig()

public static getConfig(mixed $_key[, mixed $_default = '' ]) : mixed
Parameters
$_key : mixed
$_default : mixed = ''

getDelta()

Get the log delta from $_position to the end of the file New position is stored in $_position when eof is reached

public static getDelta([string $_log = 'core' ][, int $_position = 0 ][, string $_search = '' ][, int $_colored = false ][, bool $_numbered = true ][, int $_numStart = 0 ][, int $_max = -1 ]) : array<string|int, mixed>
Parameters
$_log : string = 'core'

Log filename (default 'core')

$_position : int = 0

Bytes representing position from the begining of the file (default 0)

$_search : string = ''

Text to find in log file (default '')

$_colored : int = false

Should lines be colored (default false)

$_numbered : bool = true

Should lines be numbered (default true)

$_numStart : int = 0

At what number should lines number start (default 0)

$_max : int = -1

Max number of returned lines (default is config value "maxLineLog")

Return values
array<string|int, mixed>

Array containing log to append to buffer and new position for next call

getLastLine()

Efficiently get the last line of a file

public static getLastLine(string $_log) : string
Parameters
$_log : string

Log filename

Return values
string

The last non-empty line of the file (or '')

getLogger()

public static getLogger(mixed $_log) : mixed
Parameters
$_log : mixed

getLogLevel()

public static getLogLevel(mixed $_log) : mixed
Parameters
$_log : mixed

getPathToLog()

public static getPathToLog([mixed $_log = 'core' ]) : mixed
Parameters
$_log : mixed = 'core'

liste()

public static liste([mixed $_filtre = null ]) : mixed
Parameters
$_filtre : mixed = null

remove()

Delete log file

public static remove(mixed $_log) : mixed
Parameters
$_log : mixed

removeAll()

public static removeAll() : mixed

        
On this page

Search results