
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
diva-logger
Advanced tools
Modern, fast, lightweight and generic logger. It's based on pino (https://www.npmjs.com/package/pino).
npm install diva-logger
Use it either as
import { Logger } from 'diva-logger'
Logger.trace('hello world')
or
const Logger = require('diva-logger')
Logger.trace('hello world')
diva-logger is static. It can be used without instantiation, like
import { Logger } from 'diva-logger'
try {
throw new Error('A recoverable error')
} catch (error) {
Logger.warn(error)
// go on
}
diva-logger also attaches itself gently to the two global events uncaughtException
and unhandledRejection
. Hence an unhandled exception or an unhandled rejected promise will be properly logged (fatal):
import { Logger } from 'diva-logger'
throw new Error('This is fatal')
After an unhandled exception or unhandled rejected promise, the process will be terminated with the exit code 1 (after the remaining event stack has been processed).
diva-logger supports chaining, like
Logger.trace('trace message').debug('debug message')
Logger.trace('some trace message')
Logger.trace(process.env)
Logger.debug(12345)
Logger.info('info goes here')
Logger.warn('warning - recoverable error')
Logger.error('some serious error')
Logger.error(SomeObject)
Logger.fatal('One of the last messages of the process...')
npm run test
Coverage reports are stored within ./coverage
. Use any browser and open ./coverage/index.html
.
npm run lint
FAQs
Modern, fast, lightweight and generic pino-based logger
We found that diva-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.