-
Notifications
You must be signed in to change notification settings - Fork 105
/
winston-cloudwatch.d.ts
70 lines (65 loc) · 1.97 KB
/
winston-cloudwatch.d.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import TransportStream = require("winston-transport");
import { CloudWatchLogs, CloudWatchLogsClientConfig, LogStream } from "@aws-sdk/client-cloudwatch-logs";
import winston = require("winston");
// Declare the default WinstonCloudwatch class
declare class WinstonCloudwatch extends TransportStream {
kthxbye(callback: (err: Error) => void): void;
upload(
aws: CloudWatchLogs,
groupName: string,
streamName: string,
logEvents: any[],
retentionInDays: number,
options: WinstonCloudwatch.CloudwatchTransportOptions,
cb: (err: Error, data: any) => void
): void;
getToken(
aws: CloudWatchLogs,
groupName: string,
streamName: string,
retentionInDays: number,
options: WinstonCloudwatch.CloudwatchTransportOptions,
cb: (err: Error, data: string) => void
): void;
ensureGroupPresent(
aws: CloudWatchLogs,
name: string,
retentionInDays: number,
cb: (err: Error, data: boolean) => void
): void;
getStream(
aws: CloudWatchLogs,
groupName: string,
streamName: string,
cb: (
err: Error,
data: LogStream
) => void
): void;
ignoreInProgress(cb: (err: Error) => void): void;
constructor(options?: WinstonCloudwatch.CloudwatchTransportOptions);
}
// Export the default winston cloudwatch class
export = WinstonCloudwatch;
// Declare optional exports
declare namespace WinstonCloudwatch {
export type LogObject = winston.LogEntry;
export interface CloudwatchTransportOptions {
name?: string;
cloudWatchLogs?: CloudWatchLogs;
level?: string;
ensureLogGroup?: boolean;
logGroupName?: string | (() => string);
logStreamName?: string | (() => string);
awsAccessKeyId?: string;
awsSecretKey?: string;
awsRegion?: string;
awsOptions?: CloudWatchLogsClientConfig;
jsonMessage?: boolean;
messageFormatter?: (logObject: LogObject) => string;
uploadRate?: number;
errorHandler?: (err: Error) => void;
silent?: boolean;
retentionInDays?: number;
}
}