Use private fields

This commit is contained in:
Fabian Stamm 2020-05-18 17:06:18 +02:00
parent 1fd8da459b
commit f34800d725
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/logging", "name": "@hibas123/logging",
"version": "2.4.4", "version": "2.4.5",
"description": "", "description": "",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",

View File

@ -194,11 +194,11 @@ export class LoggingBase {
} }
} }
private $closed = false; #closed = false;
public close() { public close() {
if (this.$closed) return; if (this.#closed) return;
this.$closed = true; this.#closed = true;
this.adapterSet.adapters.forEach((adapter) => { this.adapterSet.adapters.forEach((adapter) => {
let cached = adapterCache.get(adapter); let cached = adapterCache.get(adapter);
@ -319,7 +319,7 @@ export class LoggingBase {
message: any[], message: any[],
caller?: { file: string; line: number; column?: number } caller?: { file: string; line: number; column?: number }
) { ) {
if (this.$closed) return; if (this.#closed) return;
let date = new Date().toISOString().replace(/T/, " ").replace(/\..+/, ""); let date = new Date().toISOString().replace(/T/, " ").replace(/\..+/, "");