Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
loggerhythm
Advanced tools
A winston-wrapper to log in a debug-like manner including namespaces
Loggerhythm exports a Logger-class, whose instances have different log-functions for different log-levels. the avaliable loglevels are:
error logs to stderr
, everything else logs to stdout
!
const Logger = require('loggerhythm').Logger;
// import {Logger} from 'loggerhythm'; // for TypeScript
const logger = new Logger('readme-namespace');
// alias: logger = logger.createLogger('readme-namespace');
logger.info('foo');
The output would look like this (the different log-leves use different colors):
2016-08-30T14:06:33.751Z - info: [readme-namespace] foo
2016-08-30T14:06:33.752Z - warn: [readme-namespace] bar
The Logger-Class has static methods, that can be used to globally set loggerhythm-config and register global log-hooks:
const Logger = require('loggerhythm').Logger;
// import {Logger, LogLevel} from 'loggerhythm'; // for TypeScript
// get informed about all Logs everywhere
const subscription = Logger.subscribe((logLevel, namespace, message, ...logObjects) => {
// do stuff
});
// do stuff
// unsubscribe
subscription.dispose();
The Instances of the Logger-class have a log-method for every loglevel and a subscribe-method to get informed about logs of that instance
const Logger = require('loggerhythm').Logger;
// import {Logger} from 'loggerhythm'; // for TypeScript
const logger = Logger.createLogger('readme-namespace');
// get informed about all the logs of that instance
const subscription = Logger.subscribe((logLevel, namespace, message, ...logObjects) => {
// namespace will always be 'readme-namespace' here
// do stuff
});
logger.error('error-log', new Error('hello'));
logger.warn('warning-log');
logger.info('have some info', {v1: 1, v2: 2, test: ['some', 'test', 'array']});
logger.verbose('some', 'more detailed', 'info');
// this loggers namespace will be 'readme-namespace:child-logger-lamespace'
const logger2 = logger.createChildLogger('child-logger-lamespace');
// do stuff
// unsubscribe
subscription.dispose();
FAQs
wrapper for winston to use it like debug with namespaces
The npm package loggerhythm receives a total of 0 weekly downloads. As such, loggerhythm popularity was classified as not popular.
We found that loggerhythm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.