mirror of
https://github.com/fernwerker/ownDynDNS.git
synced 2025-07-10 14:15:14 +02:00
if log=false don't require logfile
This commit is contained in:
parent
c681a763b5
commit
058a32533b
2 changed files with 22 additions and 10 deletions
|
@ -113,7 +113,15 @@ final class Config
|
||||||
$this->isAllowNetcupCreds()
|
$this->isAllowNetcupCreds()
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
!empty($this->logFile);
|
(
|
||||||
|
(
|
||||||
|
$this->isLog() &&
|
||||||
|
!empty($this->logFile)
|
||||||
|
) ||
|
||||||
|
(
|
||||||
|
$this->isLog() == false
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,10 +92,12 @@ final class Handler
|
||||||
$this->apipassword = $this->config->getApiPassword();
|
$this->apipassword = $this->config->getApiPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_readable($this->config->getLogFile())) {
|
if ($this->config->isLog()) {
|
||||||
$this->log = json_decode(file_get_contents($this->config->getLogFile()), true);
|
if (is_readable($this->config->getLogFile())) {
|
||||||
} else {
|
$this->log = json_decode(file_get_contents($this->config->getLogFile()), true);
|
||||||
$this->log[$this->payload->getDomain()] = [];
|
} else {
|
||||||
|
$this->log[$this->payload->getDomain()] = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,13 +113,15 @@ final class Handler
|
||||||
*/
|
*/
|
||||||
private function doLog($msg)
|
private function doLog($msg)
|
||||||
{
|
{
|
||||||
$this->log[$this->payload->getDomain()][] = sprintf('[%s] %s', date('c'), $msg);
|
if ($this->config->isLog()) {
|
||||||
|
$this->log[$this->payload->getDomain()][] = sprintf('[%s] %s', date('c'), $msg);
|
||||||
|
|
||||||
if ($this->config->isDebug()) {
|
if ($this->config->isDebug()) {
|
||||||
printf('[DEBUG] %s %s', $msg, PHP_EOL);
|
printf('[DEBUG] %s %s', $msg, PHP_EOL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function doExit()
|
private function doExit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue