forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileLogger.ts
50 lines (44 loc) · 1.07 KB
/
fileLogger.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
/**
* Contract for logger that writes telemetry to a file
* @internal
*/
export interface IFileLogger extends ITelemetryBaseLogger {
/**
* This method acts as a "dispose" and should be explicitly called at the end of execution
*/
close(): Promise<void>;
}
/**
* Desired output format for the telemetry
* @legacy
* @alpha
*/
export enum OutputFormat {
JSON,
CSV,
}
/**
* Options to provide upon creation of IFileLogger
* @internal
*/
export interface ITelemetryOptions {
/** Desired output format used to create a specific IFileLogger implementation */
outputFormat?: OutputFormat;
/**
* Properties that should be added to every telemetry event
*
* @example
*
* ```JSON
* { "prop1": "value1", "prop2": 10.0 }
* ```
*/
defaultProps?: Record<string, string | number>;
/** Number of telemetry events per flush to telemetry file */
eventsPerFlush?: number;
}