Remove potential new lines in reported logger instances

- Thanks to @MrKaplan-lw for the investigative work
This commit is contained in:
Hypolite Petovan 2025-01-26 14:09:21 -05:00
parent 258476e14f
commit 0006d838f5
4 changed files with 4 additions and 7 deletions

View file

@ -599,9 +599,7 @@ class Notify extends BaseRepository
DBA::insert('notify-threads', $fields);
$emailBuilder->setHeader('Message-ID', $message_id);
$log_msg = "No previous notification found for this parent:\n" .
" parent: {$params['parent']}\n" . " uid : {$params['uid']}\n";
$this->logger->info($log_msg);
$this->logger->info('No previous notification found for this parent', ['parent' => $params['parent'], 'uid' => $params['uid']]);
} else {
// If not, just "follow" the thread.
$emailBuilder->setHeader('References', $message_id);

View file

@ -310,7 +310,7 @@ class Delivery
$atom = DFRN::entries($msgitems, $owner);
}
DI::logger()->debug('Notifier entry: ' . $contact['url'] . ' ' . ($target_item_id ?? 'relocation') . ' entry: ' . $atom);
DI::logger()->debug('Notifier entry', ['url' => $contact['url'], 'target_item_id' => ($target_item_id ?? 'relocation'), 'entry' => $atom]);
$protocol = Post\DeliveryData::DFRN;

View file

@ -2790,7 +2790,7 @@ class Diaspora
*/
public static function encodePrivateData(string $msg, array $user, array $contact, string $prvkey, string $pubkey): string
{
DI::logger()->debug('Message: ' . $msg);
DI::logger()->debug('Diaspora message', ['msg' => $msg]);
// without a public key nothing will work
if (!$pubkey) {

View file

@ -207,8 +207,7 @@ class Emailer
$hookdata['parameters']
);
$this->logger->debug('header ' . 'To: ' . $email->getToAddress() . '\n' . $messageHeader);
$this->logger->debug('return value ' . (($res) ? 'true' : 'false'));
$this->logger->debug('Email message header', ['To' => $email->getToAddress(), 'messageHeader' => $messageHeader, 'return' => ($res) ? 'true' : 'false']);
return $res;
}