UNPKG

hypertune

Version:

[Hypertune](https://www.hypertune.com/) is the most flexible platform for feature flags, A/B testing, analytics and app configuration. Built with full end-to-end type-safety, Git-style version control and local, synchronous, in-memory flag evaluation. Opt

31 lines 1.42 kB
import { CreateLogsInput, LogType, LogLevel, CountMap, Event, Exposure, LocalLogger } from "../types"; /** * `RemoteLogger` provides a granular API to send evaluations, events, exposures * and generic log messages to a remote server. It queues them internally and * sends them to the remote server when the flush method is called manually. * When `flushIntervalMs` option is set to a non null value it also sends them * periodically in the background. */ export default class RemoteLogger { private readonly token; private readonly queue; private readonly createLogs; private readonly localLogger; private shouldClose; private flushLogsTimeout; constructor({ traceId, token, createLogs, localLogger, flushIntervalMs, }: { traceId: string; token: string; createLogs: (createLogTraceId: string, input: CreateLogsInput) => Promise<void>; localLogger: LocalLogger; flushIntervalMs: number | null; }); log(type: LogType, level: LogLevel, commitId: string | null, message: string, metadata: object): void; evaluations(commitId: string, evaluations: CountMap): void; events(commitId: string, events: Event[]): void; exposures(commitId: string, exposures: Exposure[]): void; flush(traceId: string): Promise<void>; close(traceId: string): Promise<void>; private startFlushIntervals; } //# sourceMappingURL=RemoteLogger.d.ts.map