Skip to content

Class: Logs

Saqib Razzaq edited this page Mar 17, 2019 · 1 revision

Logs is a tiny class that makes it easy for developers to write helpful logs for background processes.

initialize

Create initial log data

Returns

Boolean

Example
$logs = new Logs('file.log');
$logs->initialize();

exists

Check if file used to init already exists

Returns

Boolean

Example
$logs->exists();

write

Write data to log file

Parameters
[string] $txt

Data to write on new line

[boolean] $print [optional]

Prints data before writing

Returns

Boolean

Example
$logs->write('Log has been started', true);

read

Reads data from specified file

Returns

Data fetched from file

Example
$logs->read();
Clone this wiki locally