Merge pull request #1092 from moteus/logging_create_file
Fix. Create log file only if necessary.
This commit is contained in:
commit
0237697634
|
|
@ -67,18 +67,18 @@ class Logging
|
|||
$log_file = $_SESSION['logging']['log']['logfile'];
|
||||
$log_level = $_SESSION['logging']['log']['loglevel'];
|
||||
|
||||
if ($log_file) {
|
||||
$this->lfile($log_file);
|
||||
$this->lopen();
|
||||
}
|
||||
else {
|
||||
$this->lopen();
|
||||
if ($log_level !== $level) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($log_level === $level) {
|
||||
$this->lwrite("[".strtoupper($level)."] ".$msg);
|
||||
if ($log_file) {
|
||||
$this->lfile($log_file);
|
||||
}
|
||||
|
||||
$this->lopen();
|
||||
|
||||
$this->lwrite("[".strtoupper($level)."] ".$msg);
|
||||
|
||||
//close handle
|
||||
$this->lclose();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue