Socket
Socket
Sign inDemoInstall

@percy/logger

Package Overview
Dependencies
Maintainers
6
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/logger - npm Package Compare versions

Comparing version 1.0.0-beta.52 to 1.0.0-beta.53

4

dist/browser.js

@@ -25,4 +25,8 @@ "use strict";

progress() {
console.error('The log.progress() method is not supported in browsers');
}
}
exports.default = BrowserLogger;

@@ -145,2 +145,3 @@ (function() {

}), {
progress: this.progress.bind(this, name),
deprecated: this.deprecated.bind(this, name),

@@ -184,2 +185,22 @@ shouldLog: this.shouldLog.bind(this, name)

return `[${label}] ${message}${suffix}`;
} // Replaces the current line with a log message
progress(debug, message, persist) {
if (!this.shouldLog(debug, 'info')) return;
let {
stdout
} = this.constructor;
if (stdout.isTTY || !this._progress) {
message && (message = this.format(message, debug));
if (stdout.isTTY) stdout.cursorTo(0);else message && (message = message + '\n');
if (message) stdout.write(message);
if (stdout.isTTY) stdout.clearLine(1);
}
this._progress = !!message && {
message,
persist
};
} // Returns true or false if the level and debug group can write messages to stdio

@@ -250,4 +271,17 @@

write(level, message) {
let stdio = level === 'info' ? 'stdout' : 'stderr';
this.constructor[stdio].write(message + '\n');
var _this$_progress;
let {
stdout,
stderr
} = this.constructor;
let progress = stdout.isTTY && this._progress;
if (progress) {
stdout.cursorTo(0);
stdout.clearLine();
}
(level === 'info' ? stdout : stderr).write(message + '\n');
if (!((_this$_progress = this._progress) !== null && _this$_progress !== void 0 && _this$_progress.persist)) delete this._progress;else if (progress) stdout.write(progress.message);
} // Opens a socket logging connection

@@ -366,2 +400,6 @@

progress() {
console.error('The log.progress() method is not supported in browsers');
}
}

@@ -368,0 +406,0 @@

@@ -90,2 +90,3 @@ "use strict";

}), {
progress: this.progress.bind(this, name),
deprecated: this.deprecated.bind(this, name),

@@ -129,2 +130,22 @@ shouldLog: this.shouldLog.bind(this, name)

return `[${label}] ${message}${suffix}`;
} // Replaces the current line with a log message
progress(debug, message, persist) {
if (!this.shouldLog(debug, 'info')) return;
let {
stdout
} = this.constructor;
if (stdout.isTTY || !this._progress) {
message && (message = this.format(message, debug));
if (stdout.isTTY) stdout.cursorTo(0);else message && (message = message + '\n');
if (message) stdout.write(message);
if (stdout.isTTY) stdout.clearLine(1);
}
this._progress = !!message && {
message,
persist
};
} // Returns true or false if the level and debug group can write messages to stdio

@@ -195,4 +216,17 @@

write(level, message) {
let stdio = level === 'info' ? 'stdout' : 'stderr';
this.constructor[stdio].write(message + '\n');
var _this$_progress;
let {
stdout,
stderr
} = this.constructor;
let progress = stdout.isTTY && this._progress;
if (progress) {
stdout.cursorTo(0);
stdout.clearLine();
}
(level === 'info' ? stdout : stderr).write(message + '\n');
if (!((_this$_progress = this._progress) !== null && _this$_progress !== void 0 && _this$_progress.persist)) delete this._progress;else if (progress) stdout.write(progress.message);
} // Opens a socket logging connection

@@ -199,0 +233,0 @@

4

package.json
{
"name": "@percy/logger",
"version": "1.0.0-beta.52",
"version": "1.0.0-beta.53",
"license": "MIT",

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

},
"gitHead": "ebc543f148bede5ce057458ffb830dd60823837e"
"gitHead": "42c93d11a663b5e45ab75944e20f0fb63a0dda09"
}

@@ -100,2 +100,8 @@ (function() {

return Object.assign(new Writable(), {
isTTY: options && options.isTTY,
cursorTo() {},
clearLine() {},
_write(chunk, encoding, callback) {

@@ -102,0 +108,0 @@ data.push(sanitizeLog(chunk.toString(), options));

@@ -25,2 +25,6 @@ const logger = require('@percy/logger');

return Object.assign(new Writable(), {
isTTY: options && options.isTTY,
cursorTo() {},
clearLine() {},
_write(chunk, encoding, callback) {

@@ -27,0 +31,0 @@ data.push(sanitizeLog(chunk.toString(), options));

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