Skip to content

Commit 6c2db43

Browse files
committed
Batch Queries: use path instead of stream to be able to reopen FD
1 parent ccbadf4 commit 6c2db43

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
1.36.2 - 2016-mm-dd
22
-------------------
33

4+
Bug fixes:
5+
- Batch Queries logs: use path instead of stream to be able to reopen FD.
6+
47

58
1.36.1 - 2016-09-30
69
-------------------

batch/batch-logger.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
'use strict';
22

33
var bunyan = require('bunyan');
4-
var fs = require('fs');
54

65
function BatchLogger (path) {
6+
var stream = {
7+
level: 'info'
8+
};
9+
if (path) {
10+
stream.path = path;
11+
} else {
12+
stream.stream = process.stdout;
13+
}
714
this.path = path;
815
this.logger = bunyan.createLogger({
916
name: 'batch-queries',
10-
streams: [{
11-
level: 'info',
12-
stream: path ? fs.createWriteStream(path, { flags: 'a', encoding: 'utf8' }) : process.stdout
13-
}]
17+
streams: [stream]
1418
});
1519
}
1620

0 commit comments

Comments
 (0)