mongodb-log-writer
Advanced tools
Comparing version 1.0.0 to 1.0.1
/// <reference types="node" /> | ||
import { Writable } from 'stream'; | ||
declare type PlainWritable = Pick<Writable, 'write' | 'end'> & { | ||
flush?: () => void; | ||
}; | ||
export interface MongoLogId { | ||
@@ -19,8 +22,8 @@ __value: number; | ||
_logFilePath: string | null; | ||
_target: Pick<Writable, 'write' | 'end'>; | ||
_target: PlainWritable; | ||
_now: () => Date; | ||
constructor(logId: string, logFilePath: string | null, target: Pick<Writable, 'write' | 'end'>, now?: () => Date); | ||
constructor(logId: string, logFilePath: string | null, target: PlainWritable, now?: () => Date); | ||
get logId(): string; | ||
get logFilePath(): string | null; | ||
get target(): Pick<Writable, 'write' | 'end'>; | ||
get target(): PlainWritable; | ||
_write(info: MongoLogEntry, encoding: unknown, callback: (err?: Error | null | undefined) => void): void; | ||
@@ -27,0 +30,0 @@ _final(callback: (err?: Error | null | undefined) => void): void; |
@@ -105,2 +105,5 @@ "use strict"; | ||
this._target.write(bson_1.EJSON.stringify(fullInfo, { relaxed: true }) + '\n', callback); | ||
if (typeof this._target.flush === 'function') { | ||
this._target.flush(); | ||
} | ||
} | ||
@@ -107,0 +110,0 @@ _final(callback) { |
{ | ||
"name": "mongodb-log-writer", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A library for writing MongoDB logv2 messages", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
29549
290