Updated some events log messages to be more clear.

This commit is contained in:
Abdulmhsen B. A. A.
2024-08-19 15:04:33 +03:00
parent be21778101
commit a2e3a94f11
2 changed files with 19 additions and 2 deletions

View File

@@ -178,6 +178,15 @@ final readonly class ProcessProgressEvent
return $e;
}
$progress = formatDuration($item->getPlayProgress());
$writer(Level::Notice, "Processing '{id}' - '{via}: {title}' watch progress '{progress}' event.", [
'id' => $item->id,
'via' => $item->via,
'title' => $item->getName(),
'progress' => $progress,
]);
foreach ($this->queue->getQueue() as $response) {
$context = ag($response->getInfo('user_data'), 'context', []);
@@ -204,8 +213,9 @@ final readonly class ProcessProgressEvent
continue;
}
$writer(Level::Notice, "Updated '{backend}: {item.title}' watch progress.", [
$writer(Level::Notice, "Updated '{backend}: {item.title}' watch progress to '{progress}'.", [
...$context,
'progress' => $progress,
'status_code' => $response->getStatusCode(),
]);
} catch (Throwable $e) {

View File

@@ -141,6 +141,13 @@ final readonly class ProcessPushEvent
return $e;
}
$writer(Level::Notice, "Processing '{id}' - '{via}: {title}' '{state}' push event.", [
'id' => $item->id,
'via' => $item->via,
'title' => $item->getName(),
'state' => $item->isWatched() ? 'watched' : 'unwatched',
]);
foreach ($this->queue->getQueue() as $response) {
$context = ag($response->getInfo('user_data'), 'context', []);
@@ -154,7 +161,7 @@ final readonly class ProcessPushEvent
continue;
}
$writer(Level::Notice, "Marked '{backend}: {item.title}' as '{play_state}'.", $context);
$writer(Level::Notice, "Updated '{backend}: {item.title}' watch state to '{play_state}'.", $context);
} catch (Throwable $e) {
$writer(
Level::Error,