Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Surikat Log Facade
npm install --save slf
Get a logger
import { LoggerFactory } from 'slf';
const log = LoggerFactory.getLogger('name');
const log = LoggerFactory.getLogger('name:subname:subsubname');
log('Hello!'); // As level info
log.log('info', 'Hello!'); // as level info
log.log('Hello!'); // as level info (implicit)
log.trace('My Trace');
log.debug('My Debug');
log.info('My Info');
log.warn('My Warning');
log.error('My Error');
log.critical('My Critical Error');
Using util.format(...)
log.info('My Formatted %s', 'Message')
>> 'My Formatted Message'
log.info('My Formatted %d', 123)
>> 'My Formatted 123'
log.info('My Formatted %d', 123)
>> 'My Formatted 123'
Json Formatting
log.info({ a: 'aloha' })
>> { a: 'aloha' }
log.info('My Formatted %d', 123)
>> 'My Formatted 123'
log.info('My Formatted %d', 123)
>> 'My Formatted 123'
LoggerFactory.setFactory(<factory-function>);
LoggerFacotry.setFactory(ConsoleLogger);
When setting a factory provider, you can also set a level to ensure not to send logs if the level is too low.
LoggerFacotry.setFactory(ConsoleLogger, Level.Info);
SLF is nothing without a backing logging implementation. The most tiny implementation of a console.log based implementation is shipped with SLF
factory-function has the following signature:
function(loggerName) {
return function(event) {
//do something with logEvent
}
}
event = {
timeStamp: 123456767,
params: [],
name: 'logger:name'
level: 'error'
}
FAQs
Simple Logging Facade
The npm package slf receives a total of 4,398 weekly downloads. As such, slf popularity was classified as popular.
We found that slf 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.