-
Notifications
You must be signed in to change notification settings - Fork 11
Release v1.3.0 #379
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
Release v1.3.0 #379
Conversation
95ba30b to
9aa2119
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the logging system from a single global logger configuration (PINPOINT_LOG_LEVEL) to a per-logger level configuration system (PINPOINT_LOGGER_LEVELS). The changes enable independent log level management for different loggers (e.g., default logger and gRPC logger).
Key changes:
- Refactored the Logger class architecture to support multiple named logger instances with a central registry
- Removed the deprecated
PINPOINT_LOG_LEVELenvironment variable in favor ofPINPOINT_LOGGER_LEVELS - Added support for configuring individual logger levels via the new
logger-levelsconfiguration property
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/utils/log/logger.js | Restructured Logger and ChildLogger classes; Logger now manages multiple ChildLogger instances in a Map registry |
| lib/utils/log/log-builder.js | Added NoConfigLog class to track config usage; added getName() method and createGrpcLogBuilder() static method |
| lib/utils/log/types.d.ts | Removed setRootLogger method from Logger interface |
| lib/config.js | Removed logLevel property from ENV_MAP and CONFIG_FILE_MAP |
| lib/config.d.ts | Changed loggerLevels from optional to required, removed logLevel property |
| lib/pinpoint-config-default.json | Added grpcLogger to logger-levels configuration with SILENT level |
| lib/agent-builder.js | Added setLogger method to support injecting custom logger instances |
| lib/client/pinpoint-client.js | Deleted file (removed entire PinpointClient class) |
| index.js | Removed setRootLogger call; now creates and injects default logger via AgentBuilder |
| README.md | Removed PINPOINT_LOG_LEVEL documentation |
| test/utils/log/logger.test.js | Updated all test references from log to logger variable; renamed variable to avoid shadowing |
| test/config.test.js | Updated test assertion to expect both default-logger and grpcLogger in logger levels |
| test/agent/env-config.test.js | Updated tests to use PINPOINT_LOGGER_LEVELS instead of PINPOINT_LOG_LEVEL |
| test/pinpoint-config-test.json | Replaced log-level with logger-levels structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lib/utils/log/log-builder.js
Outdated
| log.appenders = this.appenders | ||
| return log | ||
| const noConfigLog = new NoConfigLog(this.name, this.level) | ||
| noConfigLog.appenders = this.appenders |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The appenders array is assigned directly without cloning, which means all NoConfigLog instances will share the same appenders array reference. This can cause unintended side effects if the array is mutated later. The assignment should clone the array: noConfigLog.appenders = [...this.appenders] or assign appenders in the constructor.
| noConfigLog.appenders = this.appenders | |
| noConfigLog.appenders = [...this.appenders] |
| t.equal(given.applicationName, "appication name", "No set PINPOINT_APPLICATION_NAME env, should equal default config") | ||
| t.equal(given.collectorIp, "localhost", "No set PINPOINT_COLLECTOR_IP env, should equal default config") | ||
| t.equal(given.logLevel, "WARN", "No set PINPOINT_LOG_LEVEL env, should equal default config") | ||
| t.deepEqual(given.loggerLevels, { 'default-logger': 'WARN', 'grpcLogger': 'SILENT' }, "No set PINPOINT_ LOGGER_LEVELS env, should equal default config") |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra space in the assertion message. 'PINPOINT_ LOGGER_LEVELS' should be 'PINPOINT_LOGGER_LEVELS'.
| t.deepEqual(given.loggerLevels, { 'default-logger': 'WARN', 'grpcLogger': 'SILENT' }, "No set PINPOINT_ LOGGER_LEVELS env, should equal default config") | |
| t.deepEqual(given.loggerLevels, { 'default-logger': 'WARN', 'grpcLogger': 'SILENT' }, "No set PINPOINT_LOGGER_LEVELS env, should equal default config") |
992485d to
be396fb
Compare
056549c to
d7b4b5b
Compare
[#358] remove unused PinpointClient
[#380] Remove deprecated logLevel configuration usage
[#381] make logger state immutable and inject default logger
[#376] Support ESM