Skip to content

@jsvision/core / LoggerOptions

Interface: LoggerOptions

Defined in: safety/logger.ts:53

Options for createLogger; every field is optional (env supplies the defaults).

Properties

enabled?

readonly optional enabled?: boolean

Defined in: safety/logger.ts:55

Force enable/disable. Default: enabled iff sink==='ring' or env.JSVISION_DEBUG==='1'.


env?

readonly optional env?: ProcessEnv

Defined in: safety/logger.ts:65

Environment to read flags from. Default: process.env. (Injectable for tests.)


fs?

readonly optional fs?: LoggerFs

Defined in: safety/logger.ts:69

Filesystem seam (injectable for tests). Default: node:fs.


level?

readonly optional level?: LogLevel

Defined in: safety/logger.ts:57

Minimum level emitted. Default: 'debug' when enabled.


path?

readonly optional path?: string

Defined in: safety/logger.ts:61

File path for the 'file' sink. Default: env.JSVISION_LOG.


sink?

readonly optional sink?: LogSink

Defined in: safety/logger.ts:59

Sink override. Default 'auto' (file if a path is set, else stderr-if-safe).


size?

readonly optional size?: number

Defined in: safety/logger.ts:63

Ring capacity in entries (sink==='ring'). Default 1024.


uiFd?

readonly optional uiFd?: number

Defined in: safety/logger.ts:67

UI output stream fd to refuse (screen-safety guard). Default: stdout fd (1).