Logger
A console-compatible logger interface used by the Adaline client and Monitor for internal diagnostic output.Import
Definition
Methods
| Method | Description |
|---|---|
debug(message, ...args) | Verbose diagnostic information, useful during development. |
info(message, ...args) | General operational messages (e.g., flush completed, deployment fetched). |
warn(message, ...args) | Potential issues that don’t prevent operation (e.g., retry attempts). |
error(message, ...args) | Failures that need attention (e.g., API errors, flush failures). |
Logger. This includes the built-in console object as well as popular logging libraries like Winston, Pino, and Bunyan.
Usage
Using debug: true
The simplest way to enable logging is the debug shortcut, which uses console as the logger:
Passing console directly
Equivalent to debug: true:
Custom logger
Provide any object that satisfies theLogger interface:
With a logging library
Works with any library that exposes the standard log-level methods:See Also
- Adaline — accepts
loggeranddebugin its constructor options