Skip to content

Release v3.3.0 #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# v3.x

## v3.3.0 - 2019-01-31

### Improvements

* Improve performance #131

## v3.2.3 - 2019-01-10

### Improvements
Expand Down
14 changes: 7 additions & 7 deletions lib/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,26 @@ class FluentSender {

emit(/*[label] <data>, [timestamp], [callback] */a0, a1, a2, a3) {
let label, data, timestamp, callback;
let tsOrCbArg, cbArg;
let timestampOrCallback, cbArg;
// Label must be string always
// Data can be almost anything
// Date can be either timestamp number or Date object
// Last argument is an optional callback
if (typeof a0 === 'string') {
label = a0;
data = a1;
tsOrCbArg = a2;
timestampOrCallback = a2;
cbArg = a3;
} else {
data = a0;
tsOrCbArg = a1;
timestampOrCallback = a1;
cbArg = a2;
}

if (typeof tsOrCbArg === 'function') {
callback = tsOrCbArg;
} else if (tsOrCbArg) {
timestamp = tsOrCbArg;
if (typeof timestampOrCallback === 'function') {
callback = timestampOrCallback;
} else if (timestampOrCallback) {
timestamp = timestampOrCallback;
if (typeof cbArg === 'function') {
callback = cbArg;
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluent-logger",
"version": "3.2.3",
"version": "3.3.0",
"main": "./lib/index.js",
"scripts": {
"test": "mocha -t 10000 --recursive",
Expand Down Expand Up @@ -35,11 +35,11 @@
},
"devDependencies": {
"async": "*",
"chai": "",
"chai": "*",
"eslint": "^5.1.0",
"eslint-plugin-node": "*",
"mocha": "*",
"selfsigned": "",
"selfsigned": "*",
"winston": "*"
},
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion test/test.winston.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('winston', () => {
expect(data[0].time).exist;
expect(data[0].data.message).to.be.equal('foo bar');
expect(data[0].data.level).to.be.equal('info');
expect(data[0].data.meta.x).to.be.equal(1);
expect(data[0].data.x).to.be.equal(1);
done();
});
}, 1000);
Expand Down