Methods
-
log
Saves a text string to a log file.
-
dump
Saves arbitrary values to a log file.
-
delete
Deletes a log file.
public static function log ($message, $file = 'error.log')
Saves a text string to a log file.
Parameters
-
$message
String to be saved to a log file.
-
$file
Path to a log file relative to the
wa-log
directory. If no path is specified then a message is saved to filewa-log/error.log
.
Example
waLog::log('My app’s error log message', 'myapp.log');
public static function dump ($var, $file = 'dump.log')
Saves arbitrary values to a log file.
Parameters
-
$var
Value which must be saved to a log file. If the value is not a string it is converted to a string. You can specify multiple values, separated by commas, before the log file path.
-
$file
Path to a log file relative to the
wa-log
directory. If no path is specified then values are saved to filewa-log/dump.log
.
Example
waLog::dump($var1, $var2, $var3, 'myapp.log');
public static function delete ($file)
Deletes a log file.
Parameters
-
$file
Path to a log file, relative to the
wa-log
directory, which must be deleted.
Example
waLog::delete('myapp.log');