import { assertNever } from '@osd/std' ; internal export type LogLevelId = 'all' | 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'off' ; internal export class LogLevel { public static readonly Off = new LogLevel ( 'off' , 1 ) ; public static readonly Fatal = new LogLevel ( 'fatal' , 2 ) ; public static readonly Error = new LogLevel ( 'error' , 3 ) ; public static readonly Warn = new LogLevel ( 'warn' , 4 ) ; public static readonly Info = new LogLevel ( 'info' , 5 ) ; public static readonly Debug = new LogLevel ( 'debug' , 6 ) ; public static readonly Trace = new LogLevel ( 'trace' , 7 ) ; public static readonly All = new LogLevel ( 'all' , 8 ) ; param level returns public static fromId ( level ) { switch ( level ) { case 'all' : return LogLevel . All ; case 'fatal' : return LogLevel . Fatal ; case 'error' : return LogLevel . Error ; case 'warn' : return LogLevel . Warn ; case 'info' : return LogLevel . Info ; case 'debug' : return LogLevel . Debug ; case 'trace' : return LogLevel . Trace ; case 'off' : return LogLevel . Off ; default : return assertNever ( level ) ; } } private constructor ( public readonly id , public readonly value ) { } param level returns public supports ( level ) { return this . value >= level . value ; } }