$Image->scaleDown(640);
$new_width = $Image->getWidth();
$new_height = $Image->getHeight();
- Logger::log('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], Logger::DEBUG);
+ Logger::info('External images scaled', ['orig_width' => $orig_width, 'new_width' => $new_width, 'orig_height' => $orig_height, 'new_height' => $new_height, 'match' => $mtch[0]]);
$s = str_replace(
$mtch[0],
'[img=' . $new_width . 'x' . $new_height. ']' . $mtch[1] . '[/img]'
. "\n",
$s
);
- Logger::log('scale_external_images: new string: ' . $s, Logger::DEBUG);
+ Logger::info('New string', ['image' => $s]);
}
}
}
// than the maximum, then don't waste time looking for the images
if ($maxlen && (strlen($body) > $maxlen)) {
- Logger::log('the total body length exceeds the limit', Logger::DEBUG);
+ Logger::info('the total body length exceeds the limit', ['maxlen' => $maxlen, 'body_len' => strlen($body)]);
$orig_body = $body;
$new_body = '';
if (($textlen + $img_start) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::log('the limit happens before an embedded image', Logger::DEBUG);
+ Logger::info('the limit happens before an embedded image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
if (($textlen + $img_end) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::log('the limit happens before the end of a non-embedded image', Logger::DEBUG);
+ Logger::info('the limit happens before the end of a non-embedded image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
if (($textlen + strlen($orig_body)) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::log('the limit happens after the end of the last image', Logger::DEBUG);
+ Logger::info('the limit happens after the end of the last image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
}
} else {
- Logger::log('the text size with embedded images extracted did not violate the limit', Logger::DEBUG);
+ Logger::info('the text size with embedded images extracted did not violate the limit');
$new_body = $new_body . $orig_body;
}
return;
}
} elseif (!isset($contact['url'])) {
- Logger::log('Empty contact: ' . json_encode($contact) . ' - ' . System::callstack(20), Logger::DEBUG);
+ Logger::info('Empty contact', ['contact' => $contact, 'callstack' => System::callstack(20)]);
}
- Logger::log('Contact '.$contact['id'].' is marked for archival', Logger::DEBUG);
+ Logger::info('Contact is marked for archival', ['id' => $contact['id']]);
// Contact already archived or "self" contact? => nothing to do
if ($contact['archive'] || $contact['self']) {
return;
}
- Logger::log('Contact '.$contact['id'].' is marked as vital again', Logger::DEBUG);
+ Logger::info('Contact is marked as vital again', ['id' => $contact['id']]);
if (!isset($contact['url']) && !empty($contact['id'])) {
$fields = ['id', 'url', 'batch'];
*/
public static function getIdForURL($url, $uid = 0, $no_update = false, $default = [], $in_loop = false)
{
- Logger::log("Get contact data for url " . $url . " and user " . $uid . " - " . System::callstack(), Logger::DEBUG);
+ Logger::info('Get contact data', ['url' => $url, 'user' => $uid]);
$contact_id = 0;