Logging: prepare message only if log level is high enough

Also some clean ups on internal method call parameters
This commit is contained in:
Clemens Schwaighofer
2023-06-05 09:30:26 +09:00
parent 86acbbb85b
commit ec3ca787fa
3 changed files with 28 additions and 12 deletions

View File

@@ -76,7 +76,12 @@ with
and > and <
EOM));
$log->info('Info message', ['info' => 'log']);
$log->notice('Notice message', ['notice' => 'log']);
$log->warning('Warning message', ['warning' => 'log']);
$log->error('Cannot process data', ['error' => 'log']);
$log->critical('Critical message', ['critical' => 'log']);
$log->alert('Alert message', ['Alert' => 'log']);
$log->emergency('Emergency message', ['Emergency' => 'log']);
print "Log File: " . $log->getLogFile() . "<br>";
$log->setLogFlag(Flag::per_run);