@eryx/logging/types Module

API Reference

Types

LevelName

type LevelName = "debug" | "info" | "warning" | "error" | "critical"

LevelInput

type LevelInput = LevelName | "warn" | number

LogAttrs

type LogAttrs = { [string]: unknown }

LogRecord

type LogRecord = { timestamp: number, timestampIso: string, level: LevelName, levelValue: number, logger: string, message: string, attrs: LogAttrs, sourcePath: string?, sourceLine: number?, sourceFunction: string? }
timestamp: number
timestampIso: string
level: LevelName
levelValue: number
logger: string
message: string
attrs: LogAttrs
sourcePath: string?
sourceLine: number?
sourceFunction: string?

Handler

type Handler = { level: LevelInput?, filter: (((record: LogRecord) → boolean))?, write: ((record: LogRecord) → ()), close: ((() → ()))? }
Handler.write(record: LogRecord)()
level: LevelInput?
filter: (((record: LogRecord) → boolean))?
close: ((() → ()))?