Skip to content

tslog Transport

NPM Version

tslog is a powerful TypeScript logging library that provides beautiful logging with full TypeScript support.

Transport Source

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

LogLayertslog
tracetrace
debugdebug
infoinfo
warnwarn
errorerror
fatalfatal