diff --git a/CHANGELOG.md b/CHANGELOG.md index dded243..8c51411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.0.1 + +Add `name` to .d.ts definition + ### 3.0.0 Move aws-sdk into devDependencies diff --git a/README.md b/README.md index 2985787..a446186 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# winston-cloudwatch [v3.0.0](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#300) +# winston-cloudwatch [v3.0.1](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#301) [![Build Status](https://travis-ci.org/lazywithclass/winston-cloudwatch.svg?branch=master)](https://travis-ci.org/lazywithclass/winston-cloudwatch) [![Coverage Status](https://coveralls.io/repos/github/lazywithclass/winston-cloudwatch/badge.svg?branch=master)](https://coveralls.io/github/lazywithclass/winston-cloudwatch?branch=master) [![Dependency Status](https://david-dm.org/lazywithclass/winston-cloudwatch.svg)](https://david-dm.org/lazywithclass/winston-cloudwatch) [![dev dependencies](https://david-dm.org/lazywithclass/winston-cloudwatch/dev-status.svg)](https://david-dm.org/lazywithclass/winston-cloudwatch#info=devDependencies) [![peer dependencies](https://david-dm.org/lazywithclass/winston-cloudwatch/peer-status.svg)](https://david-dm.org/lazywithclass/winston-cloudwatch#info=peerDependencies) ================== diff --git a/examples/typescript.ts b/examples/typescript.ts new file mode 100644 index 0000000..ed97240 --- /dev/null +++ b/examples/typescript.ts @@ -0,0 +1,19 @@ +/// + +import WinstonCloudwatch from "../typescript/winston-cloudwatch" + +const winston = require('winston'), + WinstonCloudWatch = require('../index') + +const me = winston.add(new WinstonCloudwatch({ + name: 'using-kthxbye', + logGroupName: 'testing', + logStreamName: 'another', + awsRegion: 'us-east-1' +})) + +winston.error('1') + +// flushes the logs and clears setInterval +let transport = me.transports.find(t => t.name === 'using-kthxbye') +transport.kthxbye(() => console.log('bye')) diff --git a/package.json b/package.json index 0644d82..6e567c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "winston-cloudwatch", - "version": "3.0.0", + "version": "3.0.1", "description": "Send logs to Amazon Cloudwatch using Winston.", "keywords": [ "amazon", diff --git a/typescript/winston-cloudwatch.d.ts b/typescript/winston-cloudwatch.d.ts index 0b4b176..cd0f609 100644 --- a/typescript/winston-cloudwatch.d.ts +++ b/typescript/winston-cloudwatch.d.ts @@ -51,7 +51,8 @@ declare namespace WinstonCloudwatch { export type LogObject = winston.LogEntry; export interface CloudwatchTransportOptions { - cloudWatchLogs?: CloudWatchLogs, + name: string; + cloudWatchLogs?: CloudWatchLogs; level?: string; ensureLogGroup?: boolean; logGroupName?: string | (() => string);