Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@equinor/fusion-framework-module

Package Overview
Dependencies
Maintainers
3
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion-framework-module - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

9

CHANGELOG.md

@@ -6,2 +6,11 @@ # Change Log

## [1.1.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@1.0.1...@equinor/fusion-framework-module@1.1.0) (2022-09-13)
### Features
* **module:** allow setting log levels ([017b5b3](https://github.com/equinor/fusion-framework/commit/017b5b34645aa001297f37e7aef5557e9027beee))
## [1.0.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@1.0.1-next.1...@equinor/fusion-framework-module@1.0.1) (2022-09-12)

@@ -8,0 +17,0 @@

11

dist/esm/logger.js
export class ConsoleLogger {
domain;
level = 1;
constructor(domain) {

@@ -16,12 +17,14 @@ this.domain = domain;

debug(...msg) {
process.env.NODE_ENV === 'development' && console.debug(...this._createMessage(msg));
if (process.env.NODE_ENV === 'development') {
this.level > 3 && console.debug(...this._createMessage(msg));
}
}
info(...msg) {
console.info(...this._createMessage(msg));
this.level > 2 && console.info(...this._createMessage(msg));
}
warn(...msg) {
console.warn(...this._createMessage(msg));
this.level > 1 && console.warn(...this._createMessage(msg));
}
error(...msg) {
console.error(...this._createMessage(msg));
this.level > 0 && console.error(...this._createMessage(msg));
}

@@ -28,0 +31,0 @@ }

import { AnyModule } from './types';
export declare class ConsoleLogger {
protected domain: string;
level: 0 | 1 | 2 | 3 | 4;
constructor(domain: string);

@@ -5,0 +6,0 @@ protected _createMessage(msg: unknown[]): unknown[];

{
"name": "@equinor/fusion-framework-module",
"version": "1.0.1",
"version": "1.1.0",
"description": "",

@@ -31,3 +31,3 @@ "main": "dist/esm/index.js",

},
"gitHead": "92331edc3d412391fbb33d322e7cf8769b57534e"
"gitHead": "e4865f46e0e01bb8efdbe0a542e052255ec570a8"
}
import { AnyModule } from './types';
export class ConsoleLogger {
/** - 0-1-2-3 (error-warning-info-debug) if not provided only errors are logged */
public level: 0 | 1 | 2 | 3 | 4 = 1;
constructor(protected domain: string) {}

@@ -18,12 +20,14 @@

debug(...msg: unknown[]) {
process.env.NODE_ENV === 'development' && console.debug(...this._createMessage(msg));
if (process.env.NODE_ENV === 'development') {
this.level > 3 && console.debug(...this._createMessage(msg));
}
}
info(...msg: unknown[]) {
console.info(...this._createMessage(msg));
this.level > 2 && console.info(...this._createMessage(msg));
}
warn(...msg: unknown[]) {
console.warn(...this._createMessage(msg));
this.level > 1 && console.warn(...this._createMessage(msg));
}
error(...msg: unknown[]) {
console.error(...this._createMessage(msg));
this.level > 0 && console.error(...this._createMessage(msg));
}

@@ -30,0 +34,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc