Skip to content

Commit

Permalink
feat(logs): Improve sync log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanoni committed Aug 25, 2024
1 parent fbb5d8c commit 5584ac3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/content/services/sync-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,12 @@ export class SyncManager implements Service {

const idsToSync = items.map(({ id }) => id);

logger.debug(
logger.groupCollapsed(
`Enqueue ${idsToSync.length} item(s) to sync with IDs`,
idsToSync,
);
logger.table(items, ['_id', '_displayTitle']);
logger.groupEnd();

if (this.queuedSync?.timeoutID) {
clearTimeout(this.queuedSync.timeoutID);
Expand Down
2 changes: 1 addition & 1 deletion src/content/sync/sync-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function performSyncJob(

const errorMessage = String(cause);

logger.error(error, failedItem);
logger.error(error, failedItem?.getDisplayTitle());

progressWindow.fail(errorMessage, failedItem);
}
Expand Down

0 comments on commit 5584ac3

Please sign in to comment.