-
Notifications
You must be signed in to change notification settings - Fork 192
Feature request: Allow me to set the Logger console property #4901
Copy link
Copy link
Closed as not planned
Labels
feature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utilityneed-responseThis item requires a response from a customer and will considered stale after 2 weeksThis item requires a response from a customer and will considered stale after 2 weekspending-close-response-requiredThis issue will be closed soon unless the discussion moves forwardThis issue will be closed soon unless the discussion moves forwardrejectedThis is something we will not be working on. At least, not in the measurable futureThis is something we will not be working on. At least, not in the measurable future
Metadata
Metadata
Assignees
Labels
feature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utilityneed-responseThis item requires a response from a customer and will considered stale after 2 weeksThis item requires a response from a customer and will considered stale after 2 weekspending-close-response-requiredThis issue will be closed soon unless the discussion moves forwardThis issue will be closed soon unless the discussion moves forwardrejectedThis is something we will not be working on. At least, not in the measurable futureThis is something we will not be working on. At least, not in the measurable future
Type
Projects
Status
Closed
Use case
When running my projects locally, I have lots of log messages and it can be hard to see the message I'm looking for. To fix this, I created
styled-json-console, which creates a customConsoleobject that adds syntax highlighting (ANSI colors) to the JSON output.In order for me to use my custom
Consolewith PowertoolsLogger, I have to useReflect.set()to get around theprivateaccess modifier.Example:
This works, but I noticed that when doing this, the
console.trace()patch gets undone.powertools-lambda-typescript/packages/logger/src/Logger.ts
Lines 1110 to 1115 in e055e70
It would be nice if there was an official way to do this instead of using
Reflect.set().Solution/User Experience
Add a
devConsoleoption toLoggerand use it insetConsole().Alternative solutions
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.