Skip to content

Add --duplicate-log-file Core option#618

Merged
sairon merged 1 commit into
masterfrom
duplicated-log-file
Dec 8, 2025
Merged

Add --duplicate-log-file Core option#618
sairon merged 1 commit into
masterfrom
duplicated-log-file

Conversation

@sairon
Copy link
Copy Markdown
Member

@sairon sairon commented Dec 8, 2025

Implement flag for setting home-assistant/supervisor#6400.

Summary by CodeRabbit

  • New Features
    • Added --duplicate-log-file flag to core options, enabling simultaneous logging to both a file and Systemd Journal.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 8, 2025

📝 Walkthrough

Walkthrough

A new boolean flag duplicate-log-file is added to the core options command, enabling logs to be written to a file in addition to Systemd Journal output.

Changes

Cohort / File(s) Summary
Boolean flag addition
cmd/core_options.go
Introduces new duplicate-log-file flag with default value false, integrates it into boolean value processing, and registers it for command completion.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify flag definition syntax and default value alignment with existing patterns
  • Confirm proper integration into boolean option collection logic
  • Check command completion registration follows established convention

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add --duplicate-log-file Core option' directly describes the main change: introducing a new boolean flag for duplicating logs to a file.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch duplicated-log-file

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 635b648 and 8936b0e.

📒 Files selected for processing (1)
  • cmd/core_options.go (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
*/**(html|markdown|md)

⚙️ CodeRabbit configuration file

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

  • Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • Use sentence-style capitalization also in headings.

do not comment on HTML used for icons

Avoid flagging inline HTML for embedding videos in future reviews for this repository.

Files:

  • cmd/core_options.go
🔇 Additional comments (3)
cmd/core_options.go (3)

58-58: LGTM!

The flag is correctly added to the boolean options collection loop and will be processed consistently with other boolean flags.


87-88: Verify the intended behavior of NoOptDefVal = "false".

Setting NoOptDefVal = "false" means that when users specify --duplicate-log-file without an explicit value, the flag will be set to false rather than true. This is counterintuitive, as users typically expect providing a flag to enable a feature.

For example:

  • ha core options --duplicate-log-file → sets to false (disables)
  • ha core options --duplicate-log-file=true → sets to true (enables)

This pattern matches the existing backups-exclude-database flag, so it may be intentional. Please confirm this is the desired UX.


101-101: LGTM!

The flag completion is correctly registered with boolCompletions, consistent with other boolean flags in the command.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sairon sairon merged commit 8e64468 into master Dec 8, 2025
9 checks passed
@sairon sairon deleted the duplicated-log-file branch December 8, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants