Tracer Transport
Tracer is a powerful and customizable logging library for Node.js.
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
LogLayer | Tracer |
---|---|
trace | trace |
debug | debug |
info | info |
warn | warn |
error | error |
fatal | error |