tslog Transport
tslog is a powerful TypeScript logging library that provides beautiful logging with full TypeScript support.
Installation
Install the required packages:
sh
npm i loglayer @loglayer/transport-tslog tslog
sh
pnpm add loglayer @loglayer/transport-tslog tslog
sh
yarn add loglayer @loglayer/transport-tslog tslog
Setup
typescript
import { Logger } from "tslog"
import { LogLayer } from 'loglayer'
import { TsLogTransport } from "@loglayer/transport-tslog"
const tslog = new Logger()
const log = new LogLayer({
transport: new TsLogTransport({
logger: tslog
})
})
Log Level Mapping
LogLayer | tslog |
---|---|
trace | trace |
debug | debug |
info | info |
warn | warn |
error | error |
fatal | fatal |