mirror of
https://github.com/fernwerker/ownDynDNS.git
synced 2025-07-11 14:45:42 +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,12 +92,14 @@ final class Handler
|
||||||
$this->apipassword = $this->config->getApiPassword();
|
$this->apipassword = $this->config->getApiPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->config->isLog()) {
|
||||||
if (is_readable($this->config->getLogFile())) {
|
if (is_readable($this->config->getLogFile())) {
|
||||||
$this->log = json_decode(file_get_contents($this->config->getLogFile()), true);
|
$this->log = json_decode(file_get_contents($this->config->getLogFile()), true);
|
||||||
} else {
|
} else {
|
||||||
$this->log[$this->payload->getDomain()] = [];
|
$this->log[$this->payload->getDomain()] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function __destruct()
|
public function __destruct()
|
||||||
{
|
{
|
||||||
|
@ -111,6 +113,7 @@ final class Handler
|
||||||
*/
|
*/
|
||||||
private function doLog($msg)
|
private function doLog($msg)
|
||||||
{
|
{
|
||||||
|
if ($this->config->isLog()) {
|
||||||
$this->log[$this->payload->getDomain()][] = sprintf('[%s] %s', date('c'), $msg);
|
$this->log[$this->payload->getDomain()][] = sprintf('[%s] %s', date('c'), $msg);
|
||||||
|
|
||||||
if ($this->config->isDebug()) {
|
if ($this->config->isDebug()) {
|
||||||
|
@ -119,6 +122,7 @@ final class Handler
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function doExit()
|
private function doExit()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue