Files
flipper/desktop/flipper-common/src/fb-interfaces/Logger.tsx
Michel Weststrate 91d96774f6 Move files to flipper-common
Summary: Moved Logger, sleep, timeout and server contract types to flipper-common packages.

Reviewed By: passy

Differential Revision: D31475790

fbshipit-source-id: 42d2147698875f9e919ad5250f9953f3bff3ec2d
2021-10-12 16:00:52 -07:00

45 lines
857 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its 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 LoggerTypes = 'error' | 'warn' | 'info' | 'debug';
export type LoggerTrackType =
| 'duration'
| 'usage'
| 'performance'
| 'success-rate'
| 'operation-cancelled';
export type LoggerArgs = {
isTest?: boolean;
};
export interface Logger {
track(
type: LoggerTrackType,
event: string,
data?: any,
plugin?: string,
): void;
trackTimeSince(
mark: string,
eventName?: string | null | undefined,
data?: any,
): void;
info(data: any, category: string): void;
warn(data: any, category: string): void;
error(data: any, category: string): void;
debug(data: any, category: string): void;
}