Socket
Socket
Sign inDemoInstall

electron-log

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-log - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

5

electron-log.d.ts

@@ -61,2 +61,7 @@ export type ILogLevel = "error" | "warn" | "info" | "verbose" | "debug" |

format: IFormat | string;
/**
* Use styles even if TTY isn't attached
*/
forceStyles: boolean;
}

@@ -63,0 +68,0 @@

24

lib/transports/console.js

@@ -22,2 +22,3 @@ 'use strict';

transport.level = 'silly';
transport.forceStyles = Boolean(process.env.FORCE_STYLES);

@@ -37,11 +38,16 @@ if (process.type === 'renderer') {

consoleLog(msg.level, [text].concat(msg.styles));
} else {
var styles = msg.styles;
return;
}
if (transport.format.substr && transport.format.substr(0, 2) === '%c') {
styles = ['color:' + levelToStyle(msg.level), 'color:unset']
.concat(styles);
}
var styles = msg.styles;
if (transport.format.substr && transport.format.substr(0, 2) === '%c') {
styles = ['color:' + levelToStyle(msg.level), 'color:unset']
.concat(styles);
}
if (transport.forceStyles || canUseStyles(msg.level)) {
consoleLog(msg.level, [applyAnsiStyles(text, styles)]);
} else {
consoleLog(msg.level, [text.replace(/%c/g, '')]);
}

@@ -59,2 +65,8 @@ }

function canUseStyles(level) {
var useStderr = level === 'error' || level === 'warn';
var stream = useStderr ? process.stderr : process.stdout;
return stream && stream.isTTY;
}
function consoleLog(level, args) {

@@ -61,0 +73,0 @@ if (original[level]) {

{
"name": "electron-log",
"version": "3.0.1",
"version": "3.0.2",
"description": "Just a very simple logging module for your Electron application",

@@ -49,3 +49,3 @@ "main": "index.js",

"mocha": "*",
"nw": "0.31",
"nw": "0.36.2",
"tslint": "*",

@@ -52,0 +52,0 @@ "typescript": "*",

@@ -70,2 +70,4 @@ # electron-log

- **level**, default 'silly'
- **forceStyles**, use styles in the main process even if TTY isn't attached,
default false

@@ -72,0 +74,0 @@ #### File transport

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