1.1.1 • Published 6 years ago
@offirmo/practical-logger-interface v1.1.1
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): voidgetLevel(): LogLeveladdCommonDetails(hash: Readonly<{ [k: string]: any }>): void- Log primitives: (mirroring the log levels)
fatal(message?: string, details?: Readonly<{ [k: string]: any }>): voidemerg(…) idemalert(…) idemcrit(…) idemerror(…) idemwarning(…), warn(…) idemnotice(…) ideminfo(…) idemverbose(…) idemlog(…) idemdebug(…) idemtrace(…) idemsilly(…) idem
- those functions may not do anything:
group(groupTitle?: string): voidgroupCollapsed(groupTitle?: string): voidgroupEnd(): void
Concept
Other loggers: