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

@sidneys/logger

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sidneys/logger - npm Package Compare versions

Comparing version 1.12.0 to 1.13.0

46

lib/main.js

@@ -77,3 +77,3 @@ 'use strict'

info: 'ℹī¸',
warn: '⚠ī¸',
warn: '⚠ī¸ ',
error: '🚨'

@@ -207,3 +207,3 @@ }

console.log(
`${parsed.emoji} %c[%s] %c %c%s%c %c%s%c %s`,
`${parsed.emoji} %c %s| %c %c%s%c %c%s%c %s`,
//%c

@@ -249,3 +249,3 @@ `background-color: rgba(${parsed.rgb}, 0.2); color: rgba(${parsed.rgb}, 0.8); padding: 0 0px; font-weight: normal`,

console.log(util.format(
`${parsed.emoji} [%s] %s %s %s`,
`${parsed.emoji} %s| %s %s %s`,
//[%s]

@@ -275,3 +275,14 @@ parsed.thread ? parsed.chalk(parsed.namespace) : parsed.chalk.underline(parsed.namespace),

/**
* @typedef {Object} logger
* @module logger
*/
/**
* @typedef {Object} LoggerOptions
* @property {String} namespace
* @property {Boolean} timestamp
* @property {Boolean} write
*/
/**
* @typedef {Object} Logger
* @property {function} debug

@@ -284,9 +295,8 @@ * @property {function} log

/**
* @exports logger
* @param {Object} options - Logger options
* @returns {logger}
*
* @param {LoggerOptions=} options - Logger Options
* @returns {Logger}
*/
module.exports = (options) => {
module.exports = (options = {}) => {
/**

@@ -324,3 +334,3 @@ * Get root (top-level) modules' info

// Use package name as namespace
namespace = ` └─ ${requiringModuleName}`
namespace = `â€Ļ${requiringModuleName}`
} else {

@@ -333,5 +343,7 @@ // Use filename as namespace

* Default Options
* @type {LoggerOptions}
* @const
* @default
*/
let defaultOptions = {
const defaultLoggerOptions = {
namespace: namespace,

@@ -343,3 +355,3 @@ timestamp: true,

// Resolve to currentOptions by merging in defaults
const currentOptions = _.defaultsDeep(options, defaultOptions)
const currentOptions = _.defaultsDeep(options, defaultLoggerOptions)

@@ -364,8 +376,8 @@ // Attach current options to module.exports object

return {
debug() { if (isDebug) { print('debug', Array.from(arguments))} },
log() { print('log', Array.from(arguments)) },
info() { print('log', Array.from(arguments)) },
warn() { print('warn', Array.from(arguments)) },
error() { print('error', Array.from(arguments)) }
debug: function () { if (isDebug) { print('debug', Array.from(arguments)) } },
log: function () { print('log', Array.from(arguments)) },
info: function () { print('log', Array.from(arguments)) },
warn: function () { print('warn', Array.from(arguments)) },
error: function () { print('error', Array.from(arguments)) }
}
}
{
"name": "@sidneys/logger",
"version": "1.12.0",
"version": "1.13.0",
"description": "ES6-based logger with focus on Electron cross-platform Desktop apps",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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