@launchdarkly/js-sdk-common
Version:
LaunchDarkly SDK for JavaScript - common code
33 lines • 1.13 kB
TypeScript
import { BasicLoggerOptions, LDLogger } from '../api';
/**
* A basic logger which handles filtering by level.
*
* With the default options it will write to `console.error`
* and it will use the formatting provided by `console.error`.
* If the destination is overwritten, then it will use an included
* formatter similar to `util.format`.
*
* If a formatter is available, then that should be overridden
* as well for performance.
*/
export default class BasicLogger implements LDLogger {
private _logLevel;
private _name;
private _destinations?;
private _formatter?;
/**
* This should only be used as a default fallback and not as a convenient
* solution. In most cases you should construct a new instance with the
* appropriate options for your specific needs.
*/
static get(): BasicLogger;
constructor(options: BasicLoggerOptions);
private _tryFormat;
private _tryWrite;
private _log;
error(...args: any[]): void;
warn(...args: any[]): void;
info(...args: any[]): void;
debug(...args: any[]): void;
}
//# sourceMappingURL=BasicLogger.d.ts.map