Skip to content

Commit

Permalink
add name to .d.ts definition
Browse files Browse the repository at this point in the history
  • Loading branch information
lazywithclass committed Jul 21, 2021
1 parent b1a5069 commit ba29899
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.0.1

Add `name` to .d.ts definition

### 3.0.0
Move aws-sdk into devDependencies

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
==================
Expand Down
19 changes: 19 additions & 0 deletions examples/typescript.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// <reference path="../typescript/winston-cloudwatch.d.ts" />

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'))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion typescript/winston-cloudwatch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ declare namespace WinstonCloudwatch {
export type LogObject = winston.LogEntry;

export interface CloudwatchTransportOptions {
cloudWatchLogs?: CloudWatchLogs,
name: string;

This comment has been minimized.

Copy link
@jeetkn

jeetkn Aug 12, 2021

What is name used for?
It doesn't seem to be used in index.js, is it a required value?

This comment has been minimized.

Copy link
@lazywithclass

lazywithclass Aug 13, 2021

Author Owner

@jeetkn if I recall correctly it was used in the past to mark an instance

cloudWatchLogs?: CloudWatchLogs;
level?: string;
ensureLogGroup?: boolean;
logGroupName?: string | (() => string);
Expand Down

0 comments on commit ba29899

Please sign in to comment.