Replace console.warn with LoggerService in calendar optimization #129

Closed
admin-backup wants to merge 2 commits from copilot/sub-pr-49 into THoguet/issue16
pull from: copilot/sub-pr-49
admin-backup commented 2025-11-18 00:30:03 +01:00 (Migrated from 172.24.0.1:8928)

Addresses feedback from #49 to wrap console warnings in a configurable logging service and confirms inject() usage throughout.

Changes

  • New LoggerService: Environment-aware wrapper for console methods with production suppression flag
  • Updated calendar-service.ts: Added LoggerService parameter to optimizeVacations() method signature
  • Updated calendar-year.ts: Inject and pass LoggerService to optimization flow

Example

// Before
console.warn(`Optimization stopped: ${remainingDays} days remain unplaced.`);

// After  
logger?.warn(`Optimization stopped: ${remainingDays} days remain unplaced.`);

The LoggerService can be configured via isProduction flag to disable non-error logging in production builds.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Addresses feedback from #49 to wrap console warnings in a configurable logging service and confirms inject() usage throughout. ## Changes - **New LoggerService**: Environment-aware wrapper for console methods with production suppression flag - **Updated calendar-service.ts**: Added LoggerService parameter to `optimizeVacations()` method signature - **Updated calendar-year.ts**: Inject and pass LoggerService to optimization flow ## Example ```typescript // Before console.warn(`Optimization stopped: ${remainingDays} days remain unplaced.`); // After logger?.warn(`Optimization stopped: ${remainingDays} days remain unplaced.`); ``` The LoggerService can be configured via `isProduction` flag to disable non-error logging in production builds. <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://gitlab.nessar.fr/Nessar/vac-optimizer/-/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
admin-backup commented 2025-11-18 00:30:04 +01:00 (Migrated from 172.24.0.1:8928)

assigned to @Copilot

assigned to `@Copilot`
admin-backup commented 2025-11-18 00:30:04 +01:00 (Migrated from 172.24.0.1:8928)

assigned to @THoguet

assigned to `@THoguet`
admin-backup commented 2025-11-18 00:30:06 +01:00 (Migrated from 172.24.0.1:8928)

mentioned in merge request !49

mentioned in merge request [!49](https://gitea.nessar.fr/nessar/vac-optimizer/pulls/127)
admin-backup commented 2025-11-18 00:42:25 +01:00 (Migrated from 172.24.0.1:8928)

changed title from {-[WIP] WIP address feedback on loading spinner enhancement-} to {+Replace console.warn with LoggerService in calendar optimization+}

changed title from **{-[WIP] WIP address feedback on loading spinner enhancement-}** to **{+Replace console.warn with LoggerService in calendar optimization+}**
admin-backup commented 2025-11-18 00:42:32 +01:00 (Migrated from 172.24.0.1:8928)

requested review from @THoguet

requested review from `@THoguet`
admin-backup (Migrated from 172.24.0.1:8928) closed this pull request 2025-11-18 00:44:59 +01:00

Preserved source assignment/reviewer metadata. Historical accounts stay inactive.

Source requested reviewers: admin-backup (GitLab user 3).

The linked history record retains original IDs and source dates. No historical identity was merged into nessar or granted new authentication permissions.

<!-- gitlab-to-gitea-assignment:35:MergeRequest:51 --> Preserved source assignment/reviewer metadata. Historical accounts stay inactive. Source requested reviewers: admin-backup (GitLab user 3). The linked history record retains original IDs and source dates. No historical identity was merged into nessar or granted new authentication permissions.

Preserved GitLab !51 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 5.

gitlab-35-mergerequest-51.md (SHA-256 7922eb65088f7e7690d9d076ff75766a9d8690534a385a859510135176ec2475)

gitlab-35-mergerequest-51.json (SHA-256 84edfbacb30702276a4abb157739bf9382a1c8854bce3df5cbbfab75eb7edaaf)

Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.

<!-- gitlab-to-gitea-history:35:MergeRequest:51 --> Preserved GitLab !51 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 5. [gitlab-35-mergerequest-51.md](https://gitea.nessar.fr/attachments/4695a97c-ca44-4b5f-b344-d0b608a7980c) (SHA-256 `7922eb65088f7e7690d9d076ff75766a9d8690534a385a859510135176ec2475`) [gitlab-35-mergerequest-51.json](https://gitea.nessar.fr/attachments/48337bec-d208-440e-84cb-252c449414a4) (SHA-256 `84edfbacb30702276a4abb157739bf9382a1c8854bce3df5cbbfab75eb7edaaf`) Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/vac-optimizer#129