Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@hmcts/nodejs-logging
Advanced tools
[![Greenkeeper badge](https://badges.greenkeeper.io/hmcts/nodejs-logging.svg)](https://greenkeeper.io/)
A logging component used by Reform's Node.js applications.
This is not compatible with Reform tactical logging spec. Logger 2.x should be used for tactical applications.
Some background info:
silly
(5), debug
(4), verbose
(3), info
(2), warn
(1) and error
(0).LOG_LEVEL
, the default is info
.JSON_PRINT
to true
, the default is false
:Add it as your project's dependency:
yarn add @hmcts/nodejs-logging
Require it:
const { Logger } = require('@hmcts/nodejs-logging')
Then you can create a logger instance and use it to log information:
const logger = Logger.getLogger('app.js') // app.js is just an example, can be anything that's meaningful to you
Usage are:
logger.info({
message: 'Yay, logging!'
})
or
logger.log({
level: 'info',
message: 'What time is the testing at?'
});
Above will result in the following log printed (if JSON format is enabled).
{ level: 'info',
message: 'What time is the testing at?',
label: 'app.js',
timestamp: '2017-09-30T03:57:26.875Z' }
Optionally you can use the built-in Express access logger:
const { Express } = require('@hmcts/nodejs-logging')
app.use(Express.accessLogger())
Just do
yarn test
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
[![Greenkeeper badge](https://badges.greenkeeper.io/hmcts/nodejs-logging.svg)](https://greenkeeper.io/)
The npm package @hmcts/nodejs-logging receives a total of 4,492 weekly downloads. As such, @hmcts/nodejs-logging popularity was classified as popular.
We found that @hmcts/nodejs-logging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.