This is an internal component of Offirmo’s practical logger.
- declares only TypeScript types/interfaces
- No code, 0 bytes = will do nothing to your bundle size.
- TODO explain the interface pattern
Usage
This is most likely not what you are looking for!
See the actual implementations of those interfaces:
- minimal no-op: @offirmo/practical-logger-minimal-noop
- browser: @offirmo/practical-logger-browser
- node: TODO publish to npm
Interface
A logger will have the following interface:
setLevel(level: LogLevel): void
getLevel(): LogLevel
addCommonDetails(hash: Readonly<{ [k: string]: any }>): void
- Log primitives: (mirroring the log levels)
fatal(message?: string, details?: Readonly<{ [k: string]: any }>): void
emerg(…) idem
alert(…) idem
crit(…) idem
error(…) idem
warning(…), warn(…) idem
notice(…) idem
info(…) idem
verbose(…) idem
log(…) idem
debug(…) idem
trace(…) idem
silly(…) idem
- those functions may not do anything:
group(groupTitle?: string): void
groupCollapsed(groupTitle?: string): void
groupEnd(): void
Concept
Other loggers: