Skip to content

Bug: Logger doesn't log to vscode debug terminal #926

Closed
@Stefan-WW

Description

@Stefan-WW

Hello,

While development, i run my code locally in vscode.
But the lambda-powertools-logger doesn't log to the vscode debug terminal.

The following Code shows the Problem.

`

        const logger = new Logger({ serviceName: 'MyService', logLevel: 'DEBUG' });
        logger.debug('debug');
        logger.warn('warn');
        logger.error('error');
        logger.info('info');
        console.log('real logging');
        console.warn('real warning');
        console.info('real info');`

If i use console.log etc the Loggings are shown in the vscode debug terminal.
But the logger from the powertools are not shown.

if i would add a small hack above:
//@ts-ignore logger.console = console;

Then the loggings are shown in the debug terminal.

Expected Behavior

The Logs which are written, should be also shown in the vscode debug terminal.

Environment

  • Powertools version used: 0.9.1
  • Packaging format (Layers, npm): npm
  • AWS Lambda function runtime: nodejs

Metadata

Metadata

Assignees

Labels

loggerThis item relates to the Logger Utilitynot-a-bugNew and existing bug reports incorrectly submitted as bugrejectedThis is something we will not be working on. At least, not in the measurable future

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions