Skip to content

@gvray/logger


@gvray/logger / LogOptions

Interface: LogOptions ​

Defined in: types.ts:27

Configuration options passed to the Logger constructor.

Properties ​

colors? ​

optional colors?: boolean

Defined in: types.ts:38

Whether to enable ANSI color escape codes in output. When omitted, the logger auto-detects: enabled on an interactive terminal (TTY), disabled in browsers and non-TTY streams (pipes/files) where ANSI codes would render as garbage or pollute the output.


level? ​

optional level?: LogLevel

Defined in: types.ts:29

Minimum log level. Messages below this level are not output.

Default ​

ts
LogLevel.DEBUG

namespace? ​

optional namespace?: string

Defined in: types.ts:31

Namespace prefix shown on every log line, e.g. app:http.


timestamp? ​

optional timestamp?: boolean | TimestampFormat

Defined in: types.ts:46

Timestamp format for each log line.

  • true enables ISO format
  • a string selects a built-in format ('iso' | 'locale' | 'time' | 'unix')
  • a function returns a custom formatted string

Released under the MIT License.