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.
@4lch4/logger
Advanced tools
A small utility for logging to console within NodeJS/TypeScript applications.
This module is a small utility module for logging to stdout and, if desired, to also log to files.
The module is published to the NPM registry so you're able to install it as you would any other module:
# Using NPM
npm install --save @4lch4/logger
# Using Yarn
yarn add @4lch4/logger
# Using PNPM
pnpm install @4lch4/logger
Using the logger is fairly straight forward. Import the Logger, create a new instance with some optional properties, then use that instance throughout your application:
NOTE: You can also create new instances throughout your app and it will log to the same files/locations.
import { Logger } from '@4lch4/logger'
const logger = new Logger({
// optional properties
})
logger.info('Hello, world!')
logger.error('Uh oh, something broke...')
It has 5 "levels" of logging with a color for each, which are as follows (in no particular order):
If you provide a logDir when instantiating the Logger class, each level will have a file. For example, debug would be 2021.03.17-debug.log
whereas error would be 2021.03.17-error.log
.
Each level has a function to be called for logging at that level. For example, if you want to write to the debug level, you'd do logger.debug('Debug message')
.
FAQs
A small utility for logging to console within NodeJS/TypeScript applications.
The npm package @4lch4/logger receives a total of 29 weekly downloads. As such, @4lch4/logger popularity was classified as not popular.
We found that @4lch4/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.