Some more changed log levels

This commit is contained in:
Michael 2022-08-31 05:01:22 +00:00
parent 757a5c2de9
commit f7b85092b0
14 changed files with 30 additions and 24 deletions

View file

@ -237,7 +237,7 @@ class BaseApi extends BaseModule
$posts_day = Post::countThread($condition);
if ($posts_day > $throttle_day) {
Logger::info('Daily posting limit reached', ['uid' => $uid, 'posts' => $posts_day, 'limit' => $throttle_day]);
Logger::notice('Daily posting limit reached', ['uid' => $uid, 'posts' => $posts_day, 'limit' => $throttle_day]);
$error = DI::l10n()->t('Too Many Requests');
$error_description = DI::l10n()->tt("Daily posting limit of %d post reached. The post was rejected.", "Daily posting limit of %d posts reached. The post was rejected.", $throttle_day);
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
@ -253,7 +253,7 @@ class BaseApi extends BaseModule
$posts_week = Post::countThread($condition);
if ($posts_week > $throttle_week) {
Logger::info('Weekly posting limit reached', ['uid' => $uid, 'posts' => $posts_week, 'limit' => $throttle_week]);
Logger::notice('Weekly posting limit reached', ['uid' => $uid, 'posts' => $posts_week, 'limit' => $throttle_week]);
$error = DI::l10n()->t('Too Many Requests');
$error_description = DI::l10n()->tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week);
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
@ -269,7 +269,7 @@ class BaseApi extends BaseModule
$posts_month = Post::countThread($condition);
if ($posts_month > $throttle_month) {
Logger::info('Monthly posting limit reached', ['uid' => $uid, 'posts' => $posts_month, 'limit' => $throttle_month]);
Logger::notice('Monthly posting limit reached', ['uid' => $uid, 'posts' => $posts_month, 'limit' => $throttle_month]);
$error = DI::l10n()->t('Too Many Requests');
$error_description = DI::l10n()->tt('Monthly posting limit of %d post reached. The post was rejected.', 'Monthly posting limit of %d posts reached. The post was rejected.', $throttle_month);
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);

View file

@ -82,7 +82,7 @@ class Notify extends BaseModule
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
Logger::info('Importing post with the public envelope.', ['transmitter' => $msg['author']]);
Logger::debug('Importing post with the public envelope.', ['transmitter' => $msg['author']]);
// Now we should be able to import it
$ret = DFRN::import($msg['message'], $importer, Conversation::PARCEL_DIASPORA_DFRN, Conversation::RELAY);
@ -117,7 +117,7 @@ class Notify extends BaseModule
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
Logger::info('Importing post with the private envelope.', ['transmitter' => $msg['author'], 'receiver' => $user['nickname']]);
Logger::debug('Importing post with the private envelope.', ['transmitter' => $msg['author'], 'receiver' => $user['nickname']]);
// Now we should be able to import it
$ret = DFRN::import($msg['message'], $importer, Conversation::PARCEL_DIASPORA_DFRN, Conversation::PUSH);

View file

@ -49,7 +49,7 @@ class Revoke extends BaseApi
$condition = ['client_id' => $request['client_id'], 'client_secret' => $request['client_secret'], 'access_token' => $request['token']];
$token = DBA::selectFirst('application-view', ['id'], $condition);
if (empty($token['id'])) {
Logger::warning('Token not found', $condition);
Logger::notice('Token not found', $condition);
DI::mstdnError()->Unauthorized();
}

View file

@ -88,7 +88,7 @@ class Token extends BaseApi
$token = DBA::selectFirst('application-view', ['access_token', 'created_at'], $condition);
if (!DBA::isResult($token)) {
Logger::warning('Token not found or outdated', $condition);
Logger::notice('Token not found or outdated', $condition);
DI::mstdnError()->Unauthorized();
}
} else {

View file

@ -219,7 +219,7 @@ class Photo extends BaseModule
$rest = $total - ($fetch + $data + $checksum + $output);
if (!is_null($scale) && ($scale < 4)) {
Logger::info('Performance:', ['scale' => $scale, 'resource' => $photo['resource-id'],
Logger::debug('Performance:', ['scale' => $scale, 'resource' => $photo['resource-id'],
'total' => number_format($total, 3), 'fetch' => number_format($fetch, 3),
'data' => number_format($data, 3), 'checksum' => number_format($checksum, 3),
'output' => number_format($output, 3), 'rest' => number_format($rest, 3)]);

View file

@ -75,7 +75,7 @@ class Proxy extends BaseModule
}
if (!local_user()) {
Logger::info('Redirecting not logged in user to original address', ['url' => $request['url']]);
Logger::debug('Redirecting not logged in user to original address', ['url' => $request['url']]);
System::externalRedirect($request['url']);
}
@ -87,7 +87,7 @@ class Proxy extends BaseModule
$img_str = $fetchResult->getBody();
if (!$fetchResult->isSuccess() || empty($img_str)) {
Logger::info('Error fetching image', ['image' => $request['url'], 'return' => $fetchResult->getReturnCode(), 'empty' => empty($img_str)]);
Logger::notice('Error fetching image', ['image' => $request['url'], 'return' => $fetchResult->getReturnCode(), 'empty' => empty($img_str)]);
self::responseError();
// stop.
}
@ -98,7 +98,7 @@ class Proxy extends BaseModule
$image = new Image($img_str, $mime);
if (!$image->isValid()) {
Logger::info('The image is invalid', ['image' => $request['url'], 'mime' => $mime]);
Logger::notice('The image is invalid', ['image' => $request['url'], 'mime' => $mime]);
self::responseError();
// stop.
}
@ -193,7 +193,7 @@ class Proxy extends BaseModule
private static function responseImageHttpCache(Image $img)
{
if (is_null($img) || !$img->isValid()) {
Logger::info('The cached image is invalid');
Logger::notice('The cached image is invalid');
self::responseError();
// stop.
}