This class contains the main functionalities for the logging writer in CONTENIDO.

 Methods

Constructor of the writer instance.

__construct(array $options) 

Parameters

$options

array

Array with options for the writer instance (optional)

Factory method for a new writer instance.

factory(string $writerName, array $writerOptions) : \cLogWriter
Static

Parameters

$writerName

string

Name of the writer

$writerOptions

array

Options array for the writer instance

Exceptions

\cInvalidArgumentException if the writer class with the given name does not exist or is not an instance of clogWriter

Returns

\cLogWriterLog writer instance

Returns the value of an option entry.

getOption(string $option) : mixed

Parameters

$option

string

Name of the option

Returns

mixedValue of the option entry

Returns an array with all options.

getOptions() : array

Returns

arrayArray with all options

Removes an option entry.

removeOption(string $option) : void

Parameters

$option

string

Name of the option

Sets a option.

setOption(string $option, mixed $value, boolean $force) : void

If option was set previously, it must be forced to overwrite the value.

Parameters

$option

string

Name of the option

$value

mixed

Value of the option

$force

boolean

Flag to force setting the option value (optional, default: false)

Sets the whole options array.

setOptions(array $options) : void

Parameters

$options

array

Array with options

Abstract function for the write process.

write(string $message, int $priority) : boolean

This method must be implemented in the specific writer.

Parameters

$message

string

Message to write

$priority

int

Priority of the log entry

Returns

booleanState of the write process

 Properties

 

Contains all options of the current writer instance.

$_options : array