Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable writing a log file via a --no-log-file flag #1877

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Matsuuu
Copy link
Contributor

@Matsuuu Matsuuu commented Mar 27, 2025

Heya,

While writing a Vite plugin for Hey Api I ran into the situation where it kept pushing out a lot of log files on failed attempts.

There is the log level silent solution, but that also supresses logs from successful runs etc. so I think it would be great to be able to explicitly disable the error output log file while keeping the console logs

Please let me know if I missed something

Copy link

stackblitz bot commented Mar 27, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Mar 27, 2025

🦋 Changeset detected

Latest commit: 6971f5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 10:06am

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this option under logs as logs.file (?)

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 57.23%. Comparing base (93dad69) to head (6971f5b).

Files with missing lines Patch % Lines
packages/openapi-ts/src/index.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1877      +/-   ##
==========================================
- Coverage   57.23%   57.23%   -0.01%     
==========================================
  Files         191      191              
  Lines       25954    25956       +2     
  Branches     1964     1964              
==========================================
+ Hits        14856    14857       +1     
- Misses      11089    11090       +1     
  Partials        9        9              
Flag Coverage Δ
unittests 57.23% <33.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@Matsuuu
Copy link
Contributor Author

Matsuuu commented Mar 27, 2025

Yeah, good idea. I'mma work it there

@Matsuuu
Copy link
Contributor Author

Matsuuu commented Mar 27, 2025

Pushed a new revision with the option being under logs in the config, still keeping the cli flag intact

@@ -135,6 +135,23 @@ export interface UserConfig {
| (string & {})
| Record<string, unknown>
| Input;
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with this diff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea. I merely ran the linters / formatters at the pre commit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting this accidental diff is the last thing!

@Matsuuu
Copy link
Contributor Author

Matsuuu commented Mar 27, 2025

Thanks for the comments, Implemented now.

@@ -135,6 +135,23 @@ export interface UserConfig {
| (string & {})
| Record<string, unknown>
| Input;
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting this accidental diff is the last thing!

@Matsuuu
Copy link
Contributor Author

Matsuuu commented Mar 27, 2025

img

@mrlubos
Copy link
Member

mrlubos commented Mar 27, 2025

img

Let's gooo (tests are failing)

@Matsuuu
Copy link
Contributor Author

Matsuuu commented Mar 27, 2025

Of course. The one thing I didn't realize to run. Fixing..

@Matsuuu
Copy link
Contributor Author

Matsuuu commented Mar 27, 2025

img

Copy link

pkg-pr-new bot commented Mar 27, 2025

Open in Stackblitz

@hey-api/client-axios

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-axios@1877

@hey-api/client-fetch

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-fetch@1877

@hey-api/client-next

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-next@1877

@hey-api/client-nuxt

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-nuxt@1877

@hey-api/nuxt

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@1877

@hey-api/openapi-ts

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@1877

@hey-api/vite-plugin

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@1877

commit: 6971f5b

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo

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.

2 participants