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.0 to 0.11.1

25

lib/configure.js

@@ -65,6 +65,24 @@ /**

require('colors').setTheme(options.colors);
options.prefixes = {};
options.prefixes = {};
// Use prefixTheme if specified
var theme = (options.prefixTheme || DEFAULT.OPTIONS.prefixTheme);
var prefixes = DEFAULT.OPTIONS.prefixes;
if (theme) {
prefixes = (options.prefixThemes || DEFAULT.OPTIONS.prefixThemes)[theme];
}
DEFAULT.METHODS.forEach(function (logAt) {
options.prefixes[logAt] = DEFAULT.OPTIONS.prefixes[logAt][logAt];
var prefix = prefixes[logAt];
// If a `prefix` was specified, use it instead
// (keep in mind this is only if the user didn't define `prefixes`)
var configuredPrefix = (options.prefix || DEFAULT.OPTIONS.prefix);
if (configuredPrefix) {
prefix = configuredPrefix;
}
// Add some color
var colorizedPrefix = prefix[logAt];
options.prefixes[logAt] = colorizedPrefix;
});

@@ -77,2 +95,5 @@ }

return options;

@@ -79,0 +100,0 @@ };

@@ -29,12 +29,50 @@ /**

prefixes: {
silly : '| silly | ',
verbose : '| verbose | ',
info : '| info | ',
debug : '| debug | ',
warn : '| warning | ',
error : '| error | ',
crit : '| critical| '
}
// If defined, uses a prefixTheme as default
prefixTheme: 'moderate',
// Different built-in prefix themes:
prefixThemes: {
traditional: {
silly : 'silly: ',
verbose : 'verbose: ',
info : 'info: ',
debug : 'debug: ',
warn : 'warn: ',
error : 'error: ',
crit : 'CRITICAL: '
},
abbreviated: {
silly : '[~] ',
verbose : '[v] ',
info : '[i] ',
debug : '[d] ',
warn : '[!] ',
error : '[!] ',
crit : '[CRITICAL] '
},
moderate: {
silly : '[silly] ',
verbose : '[verbose] ',
info : ' ',
debug : '[-] ',
warn : '[!] ',
error : '[err] ',
crit : '[CRITICAL] '
},
aligned: {
silly : 'silly | ',
verbose : 'verbose | ',
info : 'info | ',
debug : 'debug | ',
warn : 'warning | ',
error : 'error | ',
crit : 'CRITICAL| '
}
},
// (if specified in defaults, overrides the prefixes above)
// prefix: '||| '
},

@@ -41,0 +79,0 @@

2

package.json
{
"name": "captains-log",
"version": "0.11.0",
"version": "0.11.1",
"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