question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] not getting all DEBUG=pw:api calls into the Logger

See original GitHub issue

I am sometimes using the awesome DEBUG=pw:api to see what happens during a failure (in combination with the awesome video recording and/or inspector). All great tools.

But I would want to run my tests in CI and get the logs shown by DEBUG=pw:api into the Logger. Something like:

const { chromium } = require('playwright');  // Or 'firefox' or 'webkit'.

(async () => {
  const browser = await chromium.launch({
    debug: ['pw:api']
    logger: {
      isEnabled: (name, severity) => name === 'browser',
      log: (name, severity, message, args) => console.log(`${name} ${message}`)
    }
  });
  ...
})();

I do not want to just set DEBUG=pw:api to print to stdout but I want these specific logs only sent to the Logger so I can save it in a file during my runs. It is a great tool combined with a video, to see when something fails.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
dwalleckcommented, Nov 16, 2021

Bumping this because I would like to see if this could be improved. My team’s scenario is that they would like to log to a file or other logging sinks using something like winston. The only workaround I’ve found is to redirect output to a file like DEBUG=pw:api npx playwright test &> playwright-api.log

1reaction
pavelfeldmancommented, Oct 20, 2022

Why was this issue closed?

We are prioritizing the bugs based on the upvotes, recency and our ability to act. It looks like this issue only has a handful of upvotes, has not been touched recently and/or we lack sufficient feedback to act on it. We are closing issues like this one to keep our bug database maintainable. Please feel free to open a new issue and link this one to it if you think this is a mistake.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Debug Web API Problems in 4 Steps - Kill All Defects
In my experience, the most helpful thing to do is to determine where the error is occurring – if the client is sending...
Read more >
Debugging best practices for REST API consumers
The first step is to isolate the API issue and determine if the issue stems from calling the API, the API itself, processing...
Read more >
How to Debug REST Requests - Better Programming
Find that annoying bug by spying on the data being exchanged in four different ways.
Read more >
How to remove all debug logging calls before building the ...
I find a far easier solution is to forget all the if checks all over the place and just use ProGuard to strip...
Read more >
Debugging API calls - DocuSign
As appropriate to your question, include your code, the API log, and any other relevant information. Don't include private information, your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found