imccyu 31f4441fd4 pkg: update vendor dep 1 месяц назад
..
src 07f4047ff0 Use explicit ts specifiers for declarations 2 месяцев назад
LICENSE 72688a3888 Vendor Cordis framework packages as source 3 месяцев назад
README.md 72688a3888 Vendor Cordis framework packages as source 3 месяцев назад
package.json 31f4441fd4 pkg: update vendor dep 1 месяц назад
tsconfig.json 7f131dd4d8 refactor: rename build typings dir to types 2 месяцев назад
tsdown.config.ts 7f131dd4d8 refactor: rename build typings dir to types 2 месяцев назад

README.md

@cordisjs/plugin-logger-console

Console exporter for the built-in Cordis logger service.

Usage

import { Context } from 'cordis'
import ConsoleLogger from '@cordisjs/plugin-logger-console'

const root = new Context()
await root.plugin(ConsoleLogger, {
  showDiff: true,
  levels: {
    default: 2,
    hmr: 3,
  },
})

root.logger('app').info('started')

Config

Field Description
colors Color support level, or false to disable colors.
maxLength Maximum rendered line length before truncation.
levels Per-logger minimum level map.
showDiff Show elapsed time since the previous message.
showTime Timestamp template.
label Label width, margin, and alignment options.

The Node entry uses node:util.inspect for %o and %O; the browser entry passes log arguments through to console.