Skip to content

feat(openworkflow): pluggable logger - #879

Merged
jamescmartinez merged 4 commits into
openworkflowdev:mainfrom
cliftonc:worker-logger
Oct 12, 2026
Merged

jamescmartinez merged 4 commits into
openworkflowdev:mainfrom
cliftonc:worker-logger

Conversation

@cliftonc

Copy link
Copy Markdown
Contributor

Part of #877

Summary

Adds a console-compatible logger option (debug/info/warn/error) so worker errors can go to a structured logger. Defaults to console, so output is unchanged unless a logger is provided.

Changes

  • New Logger type (exported) and logger option on Worker and the OpenWorkflow client; newWorker() inherits the client's logger unless overridden
  • The three worker console.error calls (tick, heartbeat, critical execution error) now go through it
  • Tests for default/custom/inherited loggers; a Logging section in workers.mdx

I didn't add it to the CLI config, since the CLI has its own consola output; happy to if you'd like.

Add a `logger` option to `Worker` and to the `OpenWorkflow` client, which
passes it to workers created with `newWorker()` unless a worker sets its own.
The interface is console-compatible (`debug`, `info`, `warn`, `error`) and
defaults to `console`, so output is unchanged unless a logger is provided.
Worker tick, heartbeat, and critical execution errors now go through it.
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no outstanding issues were found.

Summary

Adds a pluggable worker logger that defaults to console.

  • Workers can send operational errors to a logger they choose.

Reviews (4) · Last reviewed commit: "test(openworkflow): cover critical execu..." · Reviewed by Greptile

Comment thread packages/openworkflow/worker/worker.ts Outdated
Comment thread apps/docs/docs/workers.mdx Outdated
Catch errors thrown by the logger so the poll loop keeps running and heartbeat
failures can't become unhandled rejections. Pass the error to pino as `err` in
the docs example so its serializer applies.
@pkg-pr-new

pkg-pr-new Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/cli@879
npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/dashboard@879
npm i https://pkg.pr.new/openworkflowdev/openworkflow@879

commit: 8a4283d

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamescmartinez
jamescmartinez enabled auto-merge (squash) October 12, 2026 15:48
@jamescmartinez

Copy link
Copy Markdown
Contributor

merging, thanks!

@jamescmartinez
jamescmartinez merged commit a82cbdf into openworkflowdev:main Oct 12, 2026
7 checks passed
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