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

captains-log

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

captains-log - npm Package Compare versions

Comparing version 0.11.10 to 0.11.11

5

lib/defaults.js

@@ -15,5 +15,10 @@ /**

////////////////////////////////////////////////////////////
// Backwards compatibility:
// (should always be true going forward)
//
// Whether to use additional `inspect` logic
// (if false- just do exactly what `console.log` would do)
inspect: true,
////////////////////////////////////////////////////////////

@@ -20,0 +25,0 @@ logLevels: {

39

lib/write.js

@@ -5,4 +5,4 @@ /**

var _ = require('lodash'),
util = require('util');
var _ = require('lodash');
var util = require('util');

@@ -37,9 +37,10 @@

// First, prepend the log prefix to the first argument
var prefixStr = (options.prefixes && options.prefixes[logAt]) || '';
if (prefixStr) {
args[0] = args[0] || '';
}
// TODO: do this here so prefixes still work when `inspect`===false
/////////////////////////////////////////////////////////////////
// For backwards-compatibility:
// (options.inspect should always be true going forward)
//
// Note that prefixes and other options will not work with
// `inspect===false`. New features will also not support
// inspect:false.
//
// If `options.inspect` is disabled, just call the log fn normally

@@ -49,7 +50,9 @@ if (!options.inspect) {

}
/////////////////////////////////////////////////////////////////
// Compose `str` of all the arguments
// (include the appropriate prefix if specified)
// For reference on the following impl, see:
// https://github.com/defunctzombie/node-util/blob/master/util.js#L22
// Combine the arguments passed into the log fn
var pieces = [];
var str = prefixStr;
_.each(arguments, function(arg) {

@@ -69,12 +72,10 @@

// Probably shouldn't do this, actually.
// if (typeof arg === 'function') {
// pieces.push(arg.valueOf());
// return;
// }
pieces.push(arg);
});
str += pieces.join(' ');
// Compose `str` of all the arguments
// (include the appropriate prefix if specified)
var prefixStr = (options.prefixes && options.prefixes[logAt]) || '';
var str = prefixStr + util.format.apply(util, pieces);
// Call log fn

@@ -81,0 +82,0 @@ return logFn.apply(logFn, [str]);

{
"name": "captains-log",
"version": "0.11.10",
"version": "0.11.11",
"description": "Simple wrapper around Winston to allow for declarative configuaration",

@@ -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