@equinor/fusion-framework-module
Advanced tools
Comparing version
@@ -6,2 +6,8 @@ # Change Log | ||
## 1.2.8 (2022-11-03) | ||
### Bug Fixes | ||
- **module:** allow debug logging ([315f845](https://github.com/equinor/fusion-framework/commit/315f845e78469a05f27793a56dd281832e7b5dd7)) | ||
## 1.2.7 (2022-11-02) | ||
@@ -8,0 +14,0 @@ |
export class ConsoleLogger { | ||
constructor(domain) { | ||
this.domain = domain; | ||
this.level = 1; | ||
this.level = process.env.NODE_ENV === 'development' ? 3 : 1; | ||
} | ||
@@ -16,5 +16,3 @@ _createMessage(msg) { | ||
debug(...msg) { | ||
if (process.env.NODE_ENV === 'development') { | ||
this.level > 3 && console.debug(...this._createMessage(msg)); | ||
} | ||
this.level > 3 && console.debug(...this._createMessage(msg)); | ||
} | ||
@@ -21,0 +19,0 @@ info(...msg) { |
{ | ||
"name": "@equinor/fusion-framework-module", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "", | ||
@@ -31,3 +31,3 @@ "main": "dist/esm/index.js", | ||
}, | ||
"gitHead": "07b75f05b0f7c01cfeb240dc1dfd1e64fbaa2267" | ||
"gitHead": "9cce61b38374a86ac2a74344e12af461b78aea5c" | ||
} |
@@ -13,3 +13,3 @@ import { AnyModule } from './types'; | ||
/** - 0-1-2-3 (error-warning-info-debug) if not provided only errors are logged */ | ||
public level: 0 | 1 | 2 | 3 | 4 = 1; | ||
public level: 0 | 1 | 2 | 3 | 4 = process.env.NODE_ENV === 'development' ? 3 : 1; | ||
constructor(protected domain: string) {} | ||
@@ -29,5 +29,3 @@ | ||
debug(...msg: unknown[]) { | ||
if (process.env.NODE_ENV === 'development') { | ||
this.level > 3 && console.debug(...this._createMessage(msg)); | ||
} | ||
this.level > 3 && console.debug(...this._createMessage(msg)); | ||
} | ||
@@ -34,0 +32,0 @@ info(...msg: unknown[]) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
128252
4.34%855
-0.47%