pino-seq 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,3 +13,5 @@ logger.info("Hello Seq, from Pino");
13
13
 
14
14
  const frLogger = logger.child({lang: "fr"});
15
15
  frLogger.warn("au reviour");
16
+
17
+ stream.flush().then((_) => console.log('flushed'));
package/index.d.ts CHANGED
@@ -11,7 +11,9 @@ declare namespace PinoSeq {
11
11
  onError?: (e: Error) => void;
12
12
  }
13
13
 
14
- function createStream(config: PinoSeq.SeqConfig): Writable;
14
+ function createStream(config: PinoSeq.SeqConfig): Writable & {
15
+ flush: () => Promise<Boolean>;
16
+ };
15
17
  }
16
18
 
17
19
  export = PinoSeq;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pino-seq",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A stream that sends Pino log events to Seq",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pinoSeqStream.js CHANGED
@@ -98,6 +98,11 @@ class PinoSeqStream extends stream.Writable {
98
98
  }
99
99
  }
100
100
 
101
+ flush() {
102
+ this.flushBuffer();
103
+ return this._logger.flush();
104
+ }
105
+
101
106
  // Force the underlying logger to flush at the time of the call
102
107
  // and wait for pending writes to complete
103
108
  _final(callback) {