Consola Transport Server
Consola is an elegant and configurable console logger for Node.js and browser.
Important Notes
- The default log level is
3which excludesdebugandtrace - Set level to
5to enable all log levels - Consola provides additional methods not available through LogLayer
Installation
Install the required packages:
sh
npm i loglayer @loglayer/transport-consola consolash
pnpm add loglayer @loglayer/transport-consola consolash
yarn add loglayer @loglayer/transport-consola consolaSetup
typescript
import { createConsola } from 'consola'
import { LogLayer } from 'loglayer'
import { ConsolaTransport } from "@loglayer/transport-consola"
const log = new LogLayer({
transport: new ConsolaTransport({
logger: createConsola({
level: 5 // Enable all log levels
})
})
})Log Level Mapping
| LogLayer | Consola |
|---|---|
| trace | trace |
| debug | debug |
| info | info |
| warn | warn |
| error | error |
| fatal | fatal |
Changelog
View the changelog here.
