iopa
Version:
API-first, Internet of Things (IoT) stack for Typescript, official implementation of the Internet Open Protocols Alliance (IOPA) reference pattern
51 lines (46 loc) • 1.18 kB
text/typescript
import { ILogger } from '@iopa/types'
function noop(): void {}
type Bindings = Record<string, any>
const logger: ILogger = {
flush: noop,
fatal: noop,
error: noop,
warn: noop,
info: noop,
debug: noop,
trace: noop,
child: () => logger,
level: 'info',
silent: noop,
isLevelEnabled: function (level: string): boolean {
throw new Error('Function not implemented.')
},
bindings: function (): Bindings {
throw new Error('Function not implemented.')
},
setBindings: function (bindings: Bindings): void {
throw new Error('Function not implemented.')
}
}
export const consoleLogger: ILogger = {
flush: noop,
fatal: console.error,
error: console.error,
warn: console.warn,
info: console.info,
debug: console.debug,
trace: console.trace,
child: () => consoleLogger,
level: 'info',
silent: noop,
isLevelEnabled: function (level: string): boolean {
throw new Error('Function not implemented.')
},
bindings: function (): Bindings {
throw new Error('Function not implemented.')
},
setBindings: function (bindings: Bindings): void {
throw new Error('Function not implemented.')
}
}
export default logger