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
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
base? | Record<string, unknown> | undefined | Additional context fields included in every log message. Useful for tagging logs with plugin name and version. | packages/hap-fluent/src/logger.ts:80 |
destination? | DestinationStream | process.stdout | Custom 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? | boolean | false | Enable pretty-printing (pino-pretty) for human-readable output. Set to false in production to emit structured JSON. | packages/hap-fluent/src/logger.ts:68 |