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

@parcel/logger

Package Overview
Dependencies
Maintainers
1
Versions
889
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/logger - npm Package Compare versions

Comparing version 2.0.0-nightly.72 to 2.0.0-nightly.79

lib/emoji.js

34

lib/Logger.js

@@ -7,3 +7,4 @@ "use strict";

exports.patchConsole = patchConsole;
exports.PluginLogger = exports.default = void 0;
exports.unpatchConsole = unpatchConsole;
exports.INTERNAL_ORIGINAL_CONSOLE = exports.PluginLogger = exports.default = void 0;

@@ -146,15 +147,16 @@ var _events = require("@parcel/events");

exports.PluginLogger = PluginLogger;
let consolePatched = false; // Patch `console` APIs within workers to forward their messages to the Logger
let consolePatched = false;
const INTERNAL_ORIGINAL_CONSOLE = _objectSpread({}, console); // Patch `console` APIs within workers to forward their messages to the Logger
// at the appropriate levels.
// TODO: Implement the rest of the console api as needed.
// TODO: Does this need to be disposable/reversible?
exports.INTERNAL_ORIGINAL_CONSOLE = INTERNAL_ORIGINAL_CONSOLE;
function patchConsole() {
if (consolePatched) {
return;
}
// Skip if console is already patched...
if (consolePatched) return;
/* eslint-disable no-console */
// $FlowFixMe
console.log = console.info = (...messages) => {

@@ -185,2 +187,18 @@ logger.info(messagesToDiagnostic(messages));

function unpatchConsole() {
// Skip if console isn't patched...
if (!consolePatched) return; // $FlowFixMe
console.log = INTERNAL_ORIGINAL_CONSOLE.log; // $FlowFixMe
console.info = INTERNAL_ORIGINAL_CONSOLE.info; // $FlowFixMe
console.debug = INTERNAL_ORIGINAL_CONSOLE.debug; // $FlowFixMe
console.warn = INTERNAL_ORIGINAL_CONSOLE.warn; // $FlowFixMe
console.error = INTERNAL_ORIGINAL_CONSOLE.error;
consolePatched = false;
}
function messagesToDiagnostic(messages) {

@@ -187,0 +205,0 @@ if (messages.length === 1 && messages[0] instanceof Error) {

{
"name": "@parcel/logger",
"version": "2.0.0-nightly.72+a0d19756",
"version": "2.0.0-nightly.79+287ac639",
"description": "Blazing fast, zero configuration web application bundler",

@@ -19,6 +19,6 @@ "license": "MIT",

"dependencies": {
"@parcel/diagnostic": "2.0.0-nightly.72+a0d19756",
"@parcel/events": "2.0.0-nightly.72+a0d19756"
"@parcel/diagnostic": "2.0.0-nightly.79+287ac639",
"@parcel/events": "2.0.0-nightly.79+287ac639"
},
"gitHead": "a0d19756a842b80ae8114b9e664a3b84057fcb70"
"gitHead": "287ac6397ade28595d56ac73971edb832bda8ff7"
}

@@ -143,11 +143,9 @@ // @flow strict-local

let consolePatched = false;
export const INTERNAL_ORIGINAL_CONSOLE = {...console};
// Patch `console` APIs within workers to forward their messages to the Logger
// at the appropriate levels.
// TODO: Implement the rest of the console api as needed.
// TODO: Does this need to be disposable/reversible?
export function patchConsole() {
if (consolePatched) {
return;
}
// Skip if console is already patched...
if (consolePatched) return;

@@ -180,2 +178,24 @@ /* eslint-disable no-console */

export function unpatchConsole() {
// Skip if console isn't patched...
if (!consolePatched) return;
// $FlowFixMe
console.log = INTERNAL_ORIGINAL_CONSOLE.log;
// $FlowFixMe
console.info = INTERNAL_ORIGINAL_CONSOLE.info;
// $FlowFixMe
console.debug = INTERNAL_ORIGINAL_CONSOLE.debug;
// $FlowFixMe
console.warn = INTERNAL_ORIGINAL_CONSOLE.warn;
// $FlowFixMe
console.error = INTERNAL_ORIGINAL_CONSOLE.error;
consolePatched = false;
}
function messagesToDiagnostic(

@@ -182,0 +202,0 @@ messages: Array<mixed>,

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