Skip to content

Feature request: export LoggerInterface in @aws-lambda-powertools/logger/types #2828

Closed
@sandrokeil

Description

@sandrokeil

Expected Behavior

The LoggerInterface should be able to be imported, so I can decorate the logger with my own implementation.

import { LoggerInterface } from '@aws-lambda-powertools/logger/types';

Current Behavior

The current export of logger types is missing the LoggerInterface from Logger.d.ts. See

export type {
LogItemMessage,
LogItemExtraInput,
LambdaFunctionContext,
UnformattedAttributes,
PowertoolsLogData,
ConstructorOptions,
InjectLambdaContextOptions,
CustomJsonReplacerFn,
} from './Logger.js';

Code snippet

import { LoggerInterface } from '@aws-lambda-powertools/logger/types';

Steps to Reproduce

  1. install powertools
  2. try to import the LoggerInterface
  3. TS2305 (no exported member) error should occur

Possible Solution

Export also LoggerInterface here

export type {
LogItemMessage,
LogItemExtraInput,
LambdaFunctionContext,
UnformattedAttributes,
PowertoolsLogData,
ConstructorOptions,
InjectLambdaContextOptions,
CustomJsonReplacerFn,
} from './Logger.js';

Powertools for AWS Lambda (TypeScript) version

latest

AWS Lambda function runtime

20.x

Packaging format used

npm

Execution logs

No response

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityloggerThis item relates to the Logger Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions