Skip to content

Commit

Permalink
add debugging infor to ktxhbye
Browse files Browse the repository at this point in the history
  • Loading branch information
lazywithclass committed Aug 28, 2021
1 parent ba29899 commit 9194093
Show file tree
Hide file tree
Showing 4 changed files with 11 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.2

Add debugging info to kthxbye

### 3.0.1

Add `name` to .d.ts definition
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.1](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#301)
# winston-cloudwatch [v3.0.2](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#302)

[![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
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,15 @@ WinstonCloudWatch.prototype.submit = function(callback) {
};

WinstonCloudWatch.prototype.kthxbye = function(callback) {
debug('clearing interval');
clearInterval(this.intervalId);
this.intervalId = null;
debug('interval cleared');
this.flushTimeout = this.flushTimeout || (Date.now() + defaultFlushTimeoutMs);
debug('flush timeout set to', this.flushTimeout);

this.submit((function(error) {
this.submit((function(error) {
debug('submit done', error);
if (error) return callback(error);
if (isEmpty(this.logEvents)) return callback();
if (Date.now() > this.flushTimeout) return callback(new Error('Timeout reached while waiting for logs to submit'));
Expand Down
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.1",
"version": "3.0.2",
"description": "Send logs to Amazon Cloudwatch using Winston.",
"keywords": [
"amazon",
Expand Down

0 comments on commit 9194093

Please sign in to comment.