
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@ethersproject/logger
Advanced tools
@ethersproject/logger is a logging utility designed for use with the ethers.js library. It provides a simple and consistent way to log messages, warnings, and errors, making it easier to debug and track issues in your Ethereum-related applications.
Logging Messages
This feature allows you to log informational messages. The logger instance is created with a context name ('my-app' in this case), which helps in identifying the source of the log messages.
const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
logger.info('This is an info message');
Logging Warnings
This feature allows you to log warning messages. Warnings are useful for indicating potential issues that are not necessarily errors but should be looked into.
const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
logger.warn('This is a warning message');
Logging Errors
This feature allows you to log error messages. Errors indicate serious issues that need immediate attention.
const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
logger.error('This is an error message');
Custom Error Codes
This feature allows you to create and throw custom errors with specific error codes. This is useful for categorizing and handling different types of errors in a more granular way.
const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
const error = logger.makeError('Custom error message', 'CUSTOM_ERROR_CODE');
logger.throwError('This is a custom error', 'CUSTOM_ERROR_CODE', { additional: 'info' });
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP). It is more feature-rich compared to @ethersproject/logger, offering advanced logging capabilities like log levels, custom formats, and more.
Bunyan is another logging library for Node.js that focuses on JSON logging. It provides a simple API for logging and supports features like log levels, serializers, and streams. Bunyan is more suited for applications that require structured logging.
Pino is a fast and low-overhead logging library for Node.js. It is designed for high-performance logging and supports features like log levels, serializers, and transports. Pino is ideal for applications where performance is a critical concern.
@TODO:
MIT License.
FAQs
Logger utility functions for ethers.
The npm package @ethersproject/logger receives a total of 1,041,288 weekly downloads. As such, @ethersproject/logger popularity was classified as popular.
We found that @ethersproject/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.