chore(server): proper log context formatting (#22173)

* Fix log formatting for logger.error(..., error)

Rewrite it to avoid printing error msg in [context]

* Fix log formatting for logger.warn(..., error?.stack)

Rewrite it to avoid printing stack in [context]

* Fix log formatting for logger.debug(..., error.message);

Rewrite it to avoid printing error msg in [context]

* Print error msg instead of literal "Error"
This commit is contained in:
Sergey Katsubo
2025-09-19 02:56:05 +03:00
committed by GitHub
parent b8a17c3c26
commit 78516a97b3
9 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ export class MemoryService extends BaseService {
try {
await Promise.all(users.map((owner, i) => this.createOnThisDayMemories(owner.id, usersIds[i], target)));
} catch (error) {
this.logger.error(`Failed to create memories for ${target.toISO()}`, error);
this.logger.error(`Failed to create memories for ${target.toISO()}: ${error}`);
}
// update system metadata even when there is an error to minimize the chance of duplicates
await this.systemMetadataRepository.set(SystemMetadataKey.MemoriesState, {