Skip to content

Don't pollute the console#15

Merged
nrigaudiere merged 3 commits into
lightpanda-io:mainfrom
regseb:console
Apr 27, 2026
Merged

Don't pollute the console#15
nrigaudiere merged 3 commits into
lightpanda-io:mainfrom
regseb:console

Conversation

@regseb
Copy link
Copy Markdown
Contributor

@regseb regseb commented Mar 28, 2026

The serve method writes to the console. This can cause problems if the program, which uses Lightpanda, writes JSON (or another structured data format) to the console.


If the user wants to log the PID, they can do so:

const process = await serve();
console.info("🐼 Running Lightpanda's CDP server…", {
    pid: process.pid,
});

Or if he wants to use a different logger:

import pino from "pino";
const logger = pino({});

const process = await serve()
logger.info({ pid: process.pid }, "🐼 Running Lightpanda's CDP server…", );

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 28, 2026

🦋 Changeset detected

Latest commit: 27b0f8f

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

This PR includes changesets to release 1 package
Name Type
@lightpanda/browser 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

Comment thread .changeset/young-bananas-cheat.md
@nrigaudiere
Copy link
Copy Markdown
Member

The serve method writes to the console. This can cause problems if the program, which uses Lightpanda, writes JSON (or another structured data format) to the console.

If the user wants to log the PID, they can do so:

const process = await serve();
console.info("🐼 Running Lightpanda's CDP server…", {
    pid: process.pid,
});

Or if he wants to use a different logger:

import pino from "pino";
const logger = pino({});

const process = await serve()
logger.info({ pid: process.pid }, "🐼 Running Lightpanda's CDP server…", );

@regseb Thanks for your PR! — the build issue has been fixed, could you rebase your branch on main so we can merge and deploy it?
Thanks!

@nrigaudiere nrigaudiere merged commit feb331c into lightpanda-io:main Apr 27, 2026
3 checks passed
@regseb regseb deleted the console branch April 27, 2026 11:27
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.

3 participants