$retrievalPolicies
$retrievalPolicies :
Logger for the extended log file format (see: https://www.w3.org/TR/WD-logfile.html).
A logger in its basic form typically handles the following tasks:
- Instantiate a LoggerContent object and provide it with a format blueprint in form of a static FormatDescriptor class
- Initialize a DataRetriever and provide it with a LoggerContent object (and if applicable with RetrievalPolicies)
- Initialize a DataValidator and provide it with a LoggerContent object
- Initialize a DataFormatter and provide it with a LoggerContent object
- Provide a method to perform the actual logging (i.e. invoke retriever, validator and formatter accordingly)
log(array $params = null) : array
Perform the actual logging process:
array | $params | Logger parameters (bool "validate" default "false", bool "format" default "true") |
Validation errors (null if none)
setDataRetrievalPolicies(array $retrievalPolicies = null)
Set data retrieval policies after initialization:
array | $retrievalPolicies | Provide policies for data retrieval. |
getInstance(array|mixed|null $inject = null) : \phpWTL\$_instance[$class]
Create new instance or give back already existing one.
array|mixed|null | $inject | Can be used to inject one or more parameter(s) into the constructor |
The instance of a derived class
buildDirectivesForFileWriter(array $fields_whitelist = null) : array
Build directives (meta data) content lines for a file writer
array | $fields_whitelist | If given two things will be done: a) only fields matching the list will be included in the "Fields" directive and b) they will be sorted according to the order of the whitelist. |
Lines
setDirectives(array $fields_whitelist = null)
Set directives (meta data) array
array | $fields_whitelist | If given two things will be done: a) only fields matching the list will be included in the "Fields" directive and b) they will be sorted according to the order of the whitelist. |
__construct(object $retrievalPolicies = null)
The constructor must perform the following taks:
object | $retrievalPolicies | Provide policies for data retrieval (if applicable). |
getDirectives(array $fields_whitelist = null) : array
Get directives (meta data) array
array | $fields_whitelist | If given two things will be done: a) only fields matching the list will be included in the "Fields" directive and b) they will be sorted according to the order of the whitelist. |
retrieveFieldsDirectiveContent(array $fields_whitelist = null) : string
Return String for "Fields" Directive
array | $fields_whitelist | If given two things will be done: a) only fields matching the list will be included in the "Fields" directive and b) they will be sorted according to the order of the whitelist. |