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

🚀 Feature Request: quiet mode for wrangler #2415

Closed
MinmoTech opened this issue Dec 14, 2022 · 3 comments · Fixed by #2627
Closed

🚀 Feature Request: quiet mode for wrangler #2415

MinmoTech opened this issue Dec 14, 2022 · 3 comments · Fixed by #2627
Assignees
Labels
d1 Relating to D1 enhancement New feature or request

Comments

@MinmoTech
Copy link

Describe the solution

I accidentally reported this on the original wrangler repo first: #2615

A kind of warning/link to the wrangler2 repo might be nice there :)

My actual issue:

I want to use r2 and d1 in scripts with wrangler. Wrangler already has a nice json output (when redirecting stdout), but it also prints spammy lines before that output:


🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🚣 Executed 1 command in 32.160559952259064ms
[
  {
    "results": [
      {
        "test1": "test",
        "test2": "test",
        "test3": 0,
        "test4": "test"
      }
    ],
    "success": true,
    "meta": {
      "duration": 32.160559952259064,
      "last_row_id": null,
      "changes": null,
      "served_by": "primary-fc09486d-3681-4906-a109-0b5e3d7737ab.db3",
      "internal_stats": null
    }
  }
]

The command I ran was NO_D1_WARNING=true wrangler d1 execute test_db --command='SELECT * FROM test_table

I would like a quiet mode for wrangler that suppresses the lines before the json output.

Describe the alternatives

Are there any alternatives to solving this problem? If so, what was your experience with them?

Those first few lines could be printed to stderr instead of to stdout.

@MinmoTech MinmoTech added the enhancement New feature or request label Dec 14, 2022
@workers-devprod workers-devprod moved this to Untriaged in workers-sdk Dec 14, 2022
@rozenmd rozenmd removed this from workers-sdk Dec 15, 2022
@rozenmd rozenmd added the d1 Relating to D1 label Dec 15, 2022
@rozenmd
Copy link
Contributor

rozenmd commented Dec 15, 2022

Fair ask - we do have WRANGLER_LOG as detailed in https://developers.cloudflare.com/workers/wrangler/system-environment-variables/ but I don't know if it'll handle this case, i'll add it to our backlog

@MinmoTech
Copy link
Author

I have now tested WRANGLER_LOG, with level log it still includes the messages with emoji when piping, on info and lower it does not output anything when piping.

On level info when not piping it correctly outputs just the table.

So if the piping behavior would be fixed this would be a solution 👍

Thanks already!

@lovette
Copy link

lovette commented Jul 18, 2024

In my search for a --quiet CLI option for deploy, I stumbled across WRANGLER_LOG, which is helpful... but any chance there's a way to silence the 🌎 Uploading... (#/#) message? It's output even for none and error which seems odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1 Relating to D1 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants