---
id: TASK-1.4
title: Add profile selection logging
status: Done
assignee:
  - codex
created_date: '2026-01-29 17:35'
updated_date: '2026-01-29 17:58'
labels: []
dependencies: []
references:
  - lua/zync/api.lua
  - lua/zync/api/configurator.lua
  - lua/zync/lib/utils.lua
  - spec/zync_spec.lua
  - spec/api_spec/configurator_spec.lua
parent_task_id: TASK-1
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add user-facing zync log messages to indicate profile selection and active profile during runs, so users can see which profile is applied when building or running commands.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 When a profile is selected (via CLI or default), zync logs the active profile name at startup or before running a command
- [x] #2 Logs are consistent with existing zync log formatting and do not spam repeated messages unnecessarily
- [x] #3 Logs should also indicate if profiles are not configured and no profile is selected
- [x] #4 Docs updated to mention profile logging behavior (if README has a logging section or relevant area)
- [x] #5 Tests updated/added to cover the new log output behavior
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Identify the best logging point (configurator vs. api.run) to emit a single profile status message per invocation.
2) Implement log messages for:
   - active profile chosen (CLI/default)
   - no profiles configured + no profile selected
3) Ensure logs use existing `zync:` prefix and avoid duplicates across commands.
4) Update README to mention profile logging behavior.
5) Add tests around log output (likely in `spec/zync_spec.lua` using the print/log stubs).
6) Run `busted` and update task notes/acceptance criteria.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added profile status logging in `lua/zync/api.lua` (logs active profile or 'No profiles configured' once per run).

Documented profile logging behavior in `README.md`.

Added log output tests in `spec/zync_spec.lua`.

Ran `busted` (all 44 specs passing).

Updated log tests for new behavior (profile log after command log, no log for init, updated message text) in `spec/zync_spec.lua`.

Ran `busted` (all 45 specs passing).
<!-- SECTION:NOTES:END -->
