Socket
Socket
Sign inDemoInstall

console-log-level

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

console-log-level - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

3

index.js

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

var levels = ['debug', 'info', 'warn', 'error', 'fatal']
var levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal']

@@ -26,2 +26,3 @@ module.exports = function (opts) {

switch (level) {
case 'trace': normalizedLevel = 'info'; break
case 'debug': normalizedLevel = 'info'; break

@@ -28,0 +29,0 @@ case 'fatal': normalizedLevel = 'error'; break

{
"name": "console-log-level",
"version": "1.1.2",
"version": "1.2.0",
"description": "The most simple logger imaginable",

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

"coordinates": [
55.687724,
12.5956242
55.6665764,
12.5798836
]
}

@@ -7,3 +7,3 @@ # console-log-level

Log levels supported: debug, info, warn, error and fatal.
Log levels supported: trace, debug, info, warn, error and fatal.

@@ -24,7 +24,8 @@ [![Build status](https://travis-ci.org/watson/console-log-level.svg?branch=master)](https://travis-ci.org/watson/console-log-level)

log.debug('a') // will not do anything
log.info('b') // will output 'b\n' on STDOUT
log.warn('c') // will output 'c\n' on STDERR
log.error('d') // will output 'd\n' on STDERR
log.fatal('e') // will output 'e\n' on STDERR
log.trace('a') // will not do anything
log.debug('b') // will not do anything
log.info('c') // will output 'c\n' on STDOUT
log.warn('d') // will output 'd\n' on STDERR
log.error('e') // will output 'e\n' on STDERR
log.fatal('f') // will output 'f\n' on STDERR
```

@@ -31,0 +32,0 @@

@@ -36,5 +36,12 @@ 'use strict'

test('log all', function (t) {
var logger = Logger({ level: 'debug' })
var logger = Logger({ level: 'trace' })
mock()
logger.trace('foo')
t.ok(console.infoCalled, 'info called')
t.notOk(console.warnCalled, 'warn not called')
t.notOk(console.errorCalled, 'error not called')
restore()
mock()
logger.debug('foo')

@@ -81,2 +88,9 @@ t.ok(console.infoCalled, 'info called')

mock()
logger.trace('foo')
t.notOk(console.infoCalled, 'info not called')
t.notOk(console.warnCalled, 'warn not called')
t.notOk(console.errorCalled, 'error not called')
restore()
mock()
logger.debug('foo')

@@ -83,0 +97,0 @@ t.notOk(console.infoCalled, 'info not called')

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