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

yog-log

Package Overview
Dependencies
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yog-log - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

22

index.js

@@ -38,4 +38,6 @@ var fs = require('fs'),

var COLORS = {
0: 'white',
1: 'red',
2: 'yellow',
3: 'magenta',
4: 'grey',

@@ -62,2 +64,3 @@ 8: 'cyan',

this.opts = this.extend({
'stdout_only': false, // 只输出 stdout,不写文件
'debug': 0,

@@ -393,7 +396,10 @@ 'intLevel': 16,

//debug模式,console.log输出颜色标记的日志
if (this.opts['debug'] && COLORS[intLevel]) {
var color = COLORS[intLevel];
var _str = unescape(str);
console.log(_str[color]);
// stdout_only 主要是给容器化部署用的,开启后也写入控制台,但没颜色
if (this.opts['stdout_only']) {
console.log(str);
// debug 模式,console.log输出颜色标记的日志
} else if (this.opts['debug'] && COLORS[intLevel]){
var color = COLORS[intLevel];
var _str = unescape(str);
console.log(_str[color]);
}

@@ -408,3 +414,3 @@

if (!fdCache[logFile]) {
if (!fdCache[logFile] && !this.opts['stdout_only']) {
// 关闭老的日志流

@@ -428,3 +434,5 @@ for (var oldFile in fdCache) {

}
fdCache[logFile].write(str);
if (!this.opts['stdout_only']) {
fdCache[logFile].write(str);
}
},

@@ -431,0 +439,0 @@

{
"name": "yog-log",
"version": "0.1.7",
"version": "0.1.8",
"description": "yog logger",

@@ -5,0 +5,0 @@ "main": "index.js",

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