@wixc3/engine-core
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -1,4 +0,4 @@ | ||
import { LoggerTransport, LogLevel } from '../../src'; | ||
import { LogMessage, LogMetadata } from '../common-types'; | ||
import { EventEmitter } from '../event-emitter'; | ||
import { LoggerTransport, LogLevel } from '../types'; | ||
export interface LogValueData { | ||
@@ -5,0 +5,0 @@ value: string; |
"use strict"; | ||
// tslint:disable: no-console | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const src_1 = require("../../src"); | ||
const event_emitter_1 = require("../event-emitter"); | ||
const types_1 = require("../types"); | ||
class LoggerService extends event_emitter_1.EventEmitter { | ||
constructor(transports = [], baseMetadata = {}, config = { severity: src_1.LogLevel.DEBUG }) { | ||
constructor(transports = [], baseMetadata = {}, config = { severity: types_1.LogLevel.DEBUG }) { | ||
super(); | ||
@@ -13,6 +13,6 @@ this.transports = transports; | ||
this.messages = []; | ||
this.debug = (value) => this.log(value, src_1.LogLevel.DEBUG); | ||
this.info = (value) => this.log(value, src_1.LogLevel.INFO); | ||
this.warn = (value) => this.log(value, src_1.LogLevel.WARN); | ||
this.error = (value) => this.log(value, src_1.LogLevel.ERROR); | ||
this.debug = (value) => this.log(value, types_1.LogLevel.DEBUG); | ||
this.info = (value) => this.log(value, types_1.LogLevel.INFO); | ||
this.warn = (value) => this.log(value, types_1.LogLevel.WARN); | ||
this.error = (value) => this.log(value, types_1.LogLevel.ERROR); | ||
} | ||
@@ -79,12 +79,12 @@ getMessages() { | ||
switch (level) { | ||
case src_1.LogLevel.DEBUG: | ||
case types_1.LogLevel.DEBUG: | ||
console.log(message, metadata); | ||
break; | ||
case src_1.LogLevel.INFO: | ||
case types_1.LogLevel.INFO: | ||
console.info(message, metadata); | ||
break; | ||
case src_1.LogLevel.WARN: | ||
case types_1.LogLevel.WARN: | ||
console.warn(message, metadata); | ||
break; | ||
case src_1.LogLevel.ERROR: | ||
case types_1.LogLevel.ERROR: | ||
console.error(message, metadata); | ||
@@ -91,0 +91,0 @@ break; |
{ | ||
"name": "@wixc3/engine-core", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"main": "cjs/index.js", | ||
@@ -29,4 +29,3 @@ "types": "cjs/index.d.ts", | ||
"access": "restricted" | ||
}, | ||
"gitHead": "f64249d3f31a1bdc1172672c96c70acd03f4e8e7" | ||
} | ||
} |
// tslint:disable: no-console | ||
import { LoggerTransport, LogLevel } from '../../src'; | ||
import { LogMessage, LogMetadata } from '../common-types'; | ||
import { EventEmitter } from '../event-emitter'; | ||
import { LoggerTransport, LogLevel } from '../types'; | ||
@@ -7,0 +7,0 @@ export interface LogValueData { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291466
164
5361
1