Skip to content

hap-fluent / LoggerOptions

Interface: LoggerOptions

Defined in: packages/hap-fluent/src/logger.ts:56

Configuration options for the global hap-fluent logger.

Config

Remarks

Pass to configureLogger once at plugin startup. All fields are optional; omitting them leaves the corresponding Pino default in effect.

Example

typescript
// Development — human-readable output
configureLogger({ level: 'debug', pretty: true });

// Production — JSON output with plugin context
configureLogger({
  level: 'warn',
  base: { plugin: 'homebridge-my-plugin', version: '2.0.0' }
});

Properties

PropertyTypeDefault valueDescriptionDefined in
base?Record<string, unknown>undefinedAdditional context fields included in every log message. Useful for tagging logs with plugin name and version.packages/hap-fluent/src/logger.ts:80
destination?DestinationStreamprocess.stdoutCustom log destination stream.packages/hap-fluent/src/logger.ts:74
level?LogLevel'info'Minimum log level to output.packages/hap-fluent/src/logger.ts:61
pretty?booleanfalseEnable pretty-printing (pino-pretty) for human-readable output. Set to false in production to emit structured JSON.packages/hap-fluent/src/logger.ts:68

Released under the Apache-2.0 License.