Skip to content

Prevent log creation when no CLI command runs - #2919

Open
nightcityblade wants to merge 3 commits into
MarkBind:masterfrom
nightcityblade:fix/issue-2829
Open

Prevent log creation when no CLI command runs#2919
nightcityblade wants to merge 3 commits into
MarkBind:masterfrom
nightcityblade:fix/issue-2829

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Fixes #2829

Overview of changes:

  • Defer the rotating file transport until Commander is about to execute a command.
  • Keep help and missing-command invocations from creating _markbind/logs.
  • Add a regression test for invoking MarkBind without a command.

Anything you'd like to highlight/discuss:

File logging remains enabled for real commands, and initialization is idempotent.

Testing instructions:

N/A; the behavior is covered by the automated CLI tests.

Proposed commit message: (wrap lines at 72 characters)

Delay CLI file logging until command


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.32%. Comparing base (36426c7) to head (1479843).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2919   +/-   ##
=======================================
  Coverage   71.32%   71.32%           
=======================================
  Files         133      133           
  Lines        7234     7234           
  Branches     1612     1581   -31     
=======================================
  Hits         5160     5160           
  Misses       2068     2068           
  Partials        6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

running markbind in a empty directory creates _markbind/logs directory (not cleaned)

2 participants