
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
js-console-logger
Advanced tools
A configurable, lightweight, opinionated JavaScript logger.
Defined log levels are trace, debug, info, warn and error.
npm i js-console-logger --save
import 'js-console-logger';
Usage is very similar to console
object.
NOTE: consoleLevel is set to trace
.
logger.trace('Network', 'API is not reposding', { url: 'www.google.com', ua: 'bot' });
logger.debug('Network', 'API is not reposding', { url: 'www.google.com', ua: 'bot' });
logger.info('Network', 'API is not reposding', { url: 'www.google.com', ua: 'bot' });
logger.warn('Network', 'API is not reposding', { url: 'www.google.com', ua: 'bot' });
logger.error('Network', 'API is not reposding', { url: 'www.google.com', ua: 'bot' });
Default configuration is good enough to start. But you can configure few options
import { consoleConfig } from 'js-console-logger';
// import { LogLevel } from 'js-console-logger/lib/types';
const isProd = process.env.NODE_ENV === 'production';
consoleConfig.setDisableConsole(isProd); // default false
consoleConfig.setConsoleLevel('info');
// default info, Use types in TS.
consoleConfig.setDisableReport(!isProd); //
consoleConfig.setReportFn((obj) => {
// report it to somewhere, call api etc.
});
consoleConfig.setReportLevel('error');
// default error, Use types in TS.
import { consoleConfig } from 'js-console-logger';
import store from '../utils/store';
import { reportLog } from '../containers/App/actions';
const reportFn = (obj) => {
store.dispatch(reportLog(obj));
};
consoleConfig.setReportFn(reportFn);
FAQs
A configurable, lightweight, opinionated JavaScript logger.
The npm package js-console-logger receives a total of 59 weekly downloads. As such, js-console-logger popularity was classified as not popular.
We found that js-console-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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.