feat(log): implement Pino-based logger#2
Open
sheplu wants to merge 4 commits into
Open
Conversation
ESM project targeting Node 24+ with a GitHub Actions quality-gates workflow.
Replace the bootstrap hello() placeholder with a real Pino-based logger that emits a consistent set of base fields (service, version, env, host, pid, runtime, logger.name) across every log line. - createLogger() factory with required service option, env/level defaults from NODE_ENV/LOG_LEVEL, and child-logger seam for future correlation - Standard field schema with reserved names (req_id, trace_id, span_id) - Default redaction paths (auth headers, passwords, tokens, secrets) with mergeable caller overrides and remove:true support - Transport selection: stdout NDJSON in production, pino-pretty to stderr in development, with explicit overrides and DestinationStream support - Error serializer wrapping pino stdSerializers.err with Node err.code - Levels re-exported as stable const so consumers don't depend on pino
Three layers covering the logger implementation: - test/unit/: pure-function tests - test/integration/: factory to capture stream to JSON parse - test/e2e/: subprocess smoke tests against the built artifact
Add two jobs to the quality gates workflow: - e2e: downloads the dist artifact from the build job and runs test:e2e:run - manifest: downloads the dist artifact and runs test:manifest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First real implementation of
@express/log, replacing thehello()placeholder.API
service,version,env,host,pid,runtime,logger.namereq_id,trace_id,span_id, …) populated by consumers vialogger.child()— not set by coreremove: truesupportstdoutin production,pino-prettytostderrin developmentpino.stdSerializers.errand adds Nodeerr.codeTests
dist/CI
Adds
e2eandmanifestjobs that reuse thebuildartifact.Out of scope
Express middleware, OTel bindings, AsyncLocalStorage, file transports — follow-up work.