1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1 4 4 1 | import {LogLevel} from './LogLevel'; export class MessageContext { constructor(readonly message: string, readonly data?: Record<string, any>) { } } export type LogMessage = string | MessageContext; export class Message extends MessageContext { constructor(readonly level: LogLevel, context: MessageContext) { super(context.message, context.data); } } |