UNPKG

flipper-common

Version:

Server & UI shared Flipper utilities

38 lines 1.17 kB
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ export type ScribeMessage = { category: string; message: string; }; /** * Send messages to arbitrary Scribe categories. This is useful to log data to * LogView, Scuba, Hive, etc. */ export declare class ScribeLogger { constructor(sender: (messages: Array<ScribeMessage>) => Promise<void>, disabled?: boolean, flushTimeout?: number); isFlushPending: boolean; queue: Array<ScribeMessage>; sendMessages: (messages: Array<ScribeMessage>) => Promise<void>; flushTimeout: number; disabled: boolean; /** * Send all the queued messages and reset. */ flushQueue: () => Promise<void>; /** * Add a message to be queued. Start a queue flush timer if one isn't already pending. */ queueSend(message: ScribeMessage): void; enforceQueueLimit(): void; /** * Messages are not guaranteed to be sent right away. */ send(message: ScribeMessage): void; } //# sourceMappingURL=ScribeLogger.d.ts.map