Skip to content

Feature request: export LogLevel values as object #2780

@adityamatt

Description

@adityamatt

Summary

LogLevel for the lambda is currently a type

type LogLevelDebug = 'DEBUG';
type LogLevelInfo = 'INFO';
type LogLevelWarn = 'WARN';
type LogLevelError = 'ERROR';
type LogLevelSilent = 'SILENT';
type LogLevelCritical = 'CRITICAL';

type LogLevel = LogLevelDebug | Lowercase<LogLevelDebug> | LogLevelInfo | Lowercase<LogLevelInfo> | LogLevelWarn | Lowercase<LogLevelWarn> | LogLevelError | Lowercase<LogLevelError> | LogLevelSilent | Lowercase<LogLevelSilent> | LogLevelCritical | Lowercase<LogLevelCritical>;

Can we turn this into an enum and export it ?

Why is this needed?

We can import this enum and use it

Which area does this relate to?

Logger

Solution

enum LogLevel {
    DEBUG = "DEBUG",
    INFO = "INFO",
    ERROR = "ERROR",
    SILENT = "SILENT",
    CRITICAL= "CRITICAL"
}


type LogLevelType = LogLevel | Lowercase<LogLevel>

Acknowledgment

Future readers

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

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 utilitygood-first-issueSomething that is suitable for those who want to start contributingloggerThis 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