Skip to content

Feature request: Enable pretty printing using code instead of environment variable #3466

@TeaDrinkingProgrammer

Description

@TeaDrinkingProgrammer

Use case

Hi all,
I am very happy with the ability to pretty print locally, but because I am using SST, it would be easier for me to enable devmode in code than to set it as an environment variable. I currently need to do this, which works but feels very hacky:

  if (Resource.App.stage != 'staging' && Resource.App.stage != 'develop' && Resource.App.stage != 'production') {
    process.env.POWERTOOLS_DEV = "true";
  }

Solution/User Experience

Something like this would be great:

  const logger = new Logger({
    ...,
   devMode: true
  });

Alternative solutions

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis item refers to a feature request for an existing or new utilityloggerThis item relates to the Logger UtilityrejectedThis is something we will not be working on. At least, not in the measurable future

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions