error_log() to \SnappyMail\LOG::*()

This commit is contained in:
djmaze 2021-12-27 12:44:49 +01:00
parent 3fc5da50ef
commit f2388bb936
8 changed files with 15 additions and 15 deletions

View file

@ -49,7 +49,7 @@ trait Metadata
}
}
} catch (\Throwable $e) {
//\error_log($e->getMessage());
//\SnappyMail\LOG::warning('IMAP', $e->getMessage());
}
return $aReturn;
}

View file

@ -1172,7 +1172,7 @@ class ImapClient extends \MailSo\Net\NetClient
// RFC 5530
if ($sEndTag === $oResponse->Tag && \is_array($oResponse->OptionalResponse) && 'CLIENTBUG' === $oResponse->OptionalResponse[0]) {
// The server has detected a client bug.
// \error_log("IMAP {$oResponse->OptionalResponse[0]}: {$this->lastCommand}");
// \SnappyMail\LOG::warning('IMAP', "{$oResponse->OptionalResponse[0]}: {$this->lastCommand}");
}
if ($sEndTag === $oResponse->Tag || Enumerations\ResponseType::CONTINUATION === $oResponse->ResponseType) {
@ -1218,7 +1218,7 @@ class ImapClient extends \MailSo\Net\NetClient
// RFC 5530
if ($sEndTag === $oResponse->Tag && \is_array($oResponse->OptionalResponse) && 'CLIENTBUG' === $oResponse->OptionalResponse[0]) {
// The server has detected a client bug.
// \error_log("IMAP {$oResponse->OptionalResponse[0]}: {$this->lastCommand}");
// \SnappyMail\LOG::warning('IMAP', "{$oResponse->OptionalResponse[0]}: {$this->lastCommand}");
}
if ($sEndTag === $oResponse->Tag || Enumerations\ResponseType::CONTINUATION === $oResponse->ResponseType) {

View file

@ -183,7 +183,7 @@ trait ResponseParser
$this->writeLog('{'.$iLiteralSize.'} '.$sLiteral, \MailSo\Log\Enumerations\Type::INFO);
}
} else {
\error_log('Literal treated as atom and skipped');
\SnappyMail\LOG::notice('IMAP', 'Literal treated as atom and skipped');
}
unset($sLiteral);
} else {
@ -238,7 +238,7 @@ trait ResponseParser
default:
case "\r":
case "\n":
\error_log('Invalid char in quoted string: "' . \substr($this->sResponseBuffer, $iPos, $iOffset + $iLength - $iPos) . '"');
\SnappyMail\LOG::notice('IMAP', 'Invalid char in quoted string: "' . \substr($this->sResponseBuffer, $iPos, $iOffset + $iLength - $iPos) . '"');
// Not allowed in quoted string
break 2;
}

View file

@ -1190,7 +1190,7 @@ class MailClient
if ($this->oImapClient->IsSupported('LIST-EXTENDED')) {
$bUseListSubscribeStatus = false;
} else if ($bUseListSubscribeStatus) {
//\error_log('RFC5258 not supported, using LSUB');
//\SnappyMail\LOG::warning('IMAP', 'RFC5258 not supported, using LSUB');
try
{
$aSubscribedFolders = $this->oImapClient->FolderSubscribeList($sParent, $sListPattern);
@ -1202,7 +1202,7 @@ class MailClient
}
catch (\Throwable $oException)
{
\error_log('ERROR FolderSubscribeList: ' . $oException->getMessage());
\SnappyMail\LOG::error('IMAP', 'FolderSubscribeList: ' . $oException->getMessage());
}
}

View file

@ -509,7 +509,7 @@ trait Messages
}
catch (\Throwable $oException)
{
\error_log("FolderHash({$sFolder}) Exception: {$oException->getMessage()}");
\SnappyMail\LOG::warning("FolderHash({$sFolder}) Exception: {$oException->getMessage()}");
}
return $this->DefaultResponse(__FUNCTION__, $sHash ? array($sFolder, $sHash) : array($sFromFolder));
@ -572,7 +572,7 @@ trait Messages
}
catch (\Throwable $oException)
{
\error_log("FolderHash({$sFromFolder}) Exception: {$oException->getMessage()}");
\SnappyMail\LOG::warning("FolderHash({$sFromFolder}) Exception: {$oException->getMessage()}");
}
return $this->DefaultResponse(__FUNCTION__, $sHash ? array($sFromFolder, $sHash) : array($sFromFolder));

View file

@ -158,9 +158,9 @@ class ServiceActions
}
catch (\Throwable $oException)
{
\error_log($oException->getMessage());
\SnappyMail\LOG::warning('SERVICE', $oException->getMessage());
if ($e = $oException->getPrevious()) {
\error_log("\t{$e->getMessage()} @ {$e->getFile()}#{$e->getLine()}");
\SnappyMail\LOG::warning('SERVICE', "\t{$e->getMessage()} @ {$e->getFile()}#{$e->getLine()}");
}
$aResponseItem = $this->oActions->ExceptionResponse(

View file

@ -24,7 +24,7 @@ class Exif
if (false !== $exif) {
return \max(0, \intval($exif['IFD0.Orientation'] ?? 0));
}
\error_log("{$image_info['mime']} " . \error_get_last()['message']);
\SnappyMail\LOG::warning('EXIF', "{$image_info['mime']} " . \error_get_last()['message']);
}
return 0;
}

View file

@ -80,14 +80,14 @@ abstract class Upgrade
\hash_hmac('sha1', '', $sHash)
];
if (!$sToken) {
\error_log("ConvertInsecureAccount {$sEmail} no token");
\SnappyMail\LOG::warning('UPGRADE', "ConvertInsecureAccount {$sEmail} no token");
continue;
}
$aAccountHash = \RainLoop\Utils::DecodeKeyValues($sToken);
if (empty($aAccountHash[0]) || 'token' !== $aAccountHash[0] // simple token validation
|| 8 > \count($aAccountHash) // length checking
) {
\error_log("ConvertInsecureAccount {$sEmail} invalid aAccountHash: " . \print_r($aAccountHash,1));
\SnappyMail\LOG::warning('UPGRADE', "ConvertInsecureAccount {$sEmail} invalid aAccountHash: " . \print_r($aAccountHash,1));
continue;
}
$aAccountHash[3] = Crypt::EncryptUrlSafe($aAccountHash[3], $sHash);
@ -103,7 +103,7 @@ abstract class Upgrade
\hash_hmac('sha1', $aAccountHash[3], $sHash)
];
} catch (\Throwable $e) {
\error_log("ConvertInsecureAccount {$sEmail} failed");
\SnappyMail\LOG::warning('UPGRADE', "ConvertInsecureAccount {$sEmail} failed");
}
}