Skip to content

Tracer Transport

NPM Version

Tracer is a powerful and customizable logging library for Node.js.

Transport Source

Installation

Install the required packages:

sh
npm i loglayer @loglayer/transport-tracer tracer
sh
pnpm add loglayer @loglayer/transport-tracer tracer
sh
yarn add loglayer @loglayer/transport-tracer tracer

Setup

typescript
import { LogLayer } from 'loglayer'
import { TracerTransport } from '@loglayer/transport-tracer'
import tracer from 'tracer'

// Create a tracer logger instance
const logger = tracer.console()

const log = new LogLayer({
  transport: new TracerTransport({
    id: 'tracer',
    logger
  })
})

Log Level Mapping

LogLayerTracer
tracetrace
debugdebug
infoinfo
warnwarn
errorerror
fatalerror