diff --git a/AGENTS.md b/AGENTS.md index a125ea8e..efeceb71 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -308,3 +308,14 @@ We use a custom workflow engine that supports both **Local** (polling-based) and ## Radix UI / Shadcn UI Patterns - **Modal Overlays**: When triggering a dialog (e.g., `Dialog`, `AlertDialog`) from inside a `DropdownMenu`, you must set `modal={false}` on the `` component. Failing to do so will cause the UI to freeze due to conflicting focus management between the two modal components. + +## Logging + +We use **pino** for logging. Always use **structured logging** to ensure logs are easily searchable and machine-readable. + +- **Import**: `import { logger } from '@/logger'` +- **Usage**: Pass an object as the first argument containing the metadata, and a string as the second argument for the descriptive message. + ```typescript + logger.info({ userId: user.id, projectId }, 'Project deleted successfully') + ``` +- **Levels**: Use appropriate levels: `debug`, `info`, `warn`, `error`. diff --git a/src/services/asset/asset.ts b/src/services/asset/asset.ts index a1263898..282bc913 100644 --- a/src/services/asset/asset.ts +++ b/src/services/asset/asset.ts @@ -894,6 +894,11 @@ export class AssetService { }) logger.info( + { + purgedCount: successfulIds.length, + physicalFilesDeleted, + physicalFoldersDeleted, + }, `${successfulIds.length} assets purged, deleted ${physicalFilesDeleted} files in ${physicalFoldersDeleted} folders`, ) }