Last active
December 4, 2018 20:22
-
-
Save lazywithclass/c8ff480ff812fb5498cf7feda6416f98 to your computer and use it in GitHub Desktop.
Revisions
-
lazywithclass revised this gist
Dec 4, 2018 . 1 changed file with 10 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,18 +3,19 @@ import * as Transport from 'winston-transport'; import { CloudWatch, CloudWatchLogs } from 'aws-sdk'; export namespace WinstonCloudWatch { export type LogObject = {level: string, msg: string, meta?: any}; export interface CloudWatchIntegration { upload(aws: CloudWatchLogs, groupName: string, streamName: string, logEvents: any[], retentionInDays: number, cb: ((err: Error, data: any) => void)): void; getToken(aws: CloudWatchLogs, groupName: string, streamName: string, retentionInDays: number, 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: CloudWatchLogs.Types.DescribeLogStreamsResponse) => void)): void; ignoreInProgress(cb: ((err: Error) => void)): void; new(options?: CloudwatchTransportOptions): winston.Logger; } export interface CloudwatchTransportOptions { level?: string; logGroupName?: string | (() => string); @@ -31,10 +32,6 @@ declare module "winston" { silent?: boolean; } export interface CloudwatchTransportInstance extends winston.Logger { new(options?: CloudwatchTransportOptions): CloudwatchTransportInstance; kthxbye(cb: (() => void)): void; -
lazywithclass created this gist
Dec 4, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ import * as winston from 'winston'; import * as Transport from 'winston-transport'; import { CloudWatch, CloudWatchLogs } from 'aws-sdk'; interface CloudWatchIntegration { upload(aws: CloudWatchLogs, groupName: string, streamName: string, logEvents: any[], retentionInDays: number, cb: ((err: Error, data: any) => void)): void; getToken(aws: CloudWatchLogs, groupName: string, streamName: string, retentionInDays: number, 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: CloudWatchLogs.Types.DescribeLogStreamsResponse) => void)): void; ignoreInProgress(cb: ((err: Error) => void)): void; } declare module "winston" { export type LogObject = {level: string, msg: string, meta?: any}; export interface CloudwatchTransportOptions { level?: string; logGroupName?: string | (() => string); logStreamName?: string | (() => string); awsAccessKeyId?: string; awsSecretKey?: string; awsRegion?: string; awsOptions?: CloudWatch.Types.ClientConfiguration; jsonMessage?: boolean; messageFormatter?: (logObject: LogObject) => string; proxyServer?: string; uploadRate?: number; errorHandler?: ((err: Error) => void); silent?: boolean; } export interface Winston { add(transport: Transport): winston.Logger; } export interface CloudwatchTransportInstance extends winston.Logger { new(options?: CloudwatchTransportOptions): CloudwatchTransportInstance; kthxbye(cb: (() => void)): void; } export interface Transports { CloudWatch: CloudwatchTransportInstance } }