Logger
Class Logger Manage errors in Log Table.
Table of Contents
Constants
Methods
- __construct() : mixed
- Logger constructor.
- addError() : bool
- Add new error in log.
- addLog() : mixed
- Log is like error, but not error.
- clearLog() : bool
- Delete all errors from log (for one export ID)
- clearOneError() : mixed
- createLogFileContent() : mixed
- getErrorExpandScript() : mixed
- Return string with js-script for expand not critical errors
- getErrorsList() : array<string|int, mixed>|string
- Return existing errors in text format for view on page
Constants
MAX_SHOWING_ERRORS_ITEMS
public
mixed
MAX_SHOWING_ERRORS_ITEMS
= 5
Methods
__construct()
Logger constructor.
public
__construct(mixed $exportId) : mixed
Parameters
- $exportId : mixed
-
- int, ID of export profile
addError()
Add new error in log.
public
addError(mixed $errCode[, null $itemId = null ][, mixed $errParams = null ]) : bool
If error by this code already exist - match time. Use newer error, If set Item - adding in items list, if not - set only text error.
Parameters
- $errCode : mixed
-
- string of error code, from predetermined list
- $itemId : null = null
- $errParams : mixed = null
Tags
Return values
booladdLog()
Log is like error, but not error.
public
addLog([mixed $itemId = null ][, mixed $params = null ]) : mixed
It is equal entities, but we always set ErrorCode in "log".
Parameters
- $itemId : mixed = null
- $params : mixed = null
clearLog()
Delete all errors from log (for one export ID)
public
clearLog() : bool
Tags
Return values
boolclearOneError()
public
clearOneError(mixed $errCode) : mixed
Parameters
- $errCode : mixed
-
- string of error code, from predetermined list
Tags
createLogFileContent()
public
static createLogFileContent(mixed $exportId) : mixed
Parameters
- $exportId : mixed
getErrorExpandScript()
Return string with js-script for expand not critical errors
public
getErrorExpandScript() : mixed
getErrorsList()
Return existing errors in text format for view on page
public
getErrorsList([mixed $flagCritical = false ]) : array<string|int, mixed>|string
Parameters
- $flagCritical : mixed = false