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.
@walletconnect/logger
Advanced tools
@walletconnect/logger is a logging utility designed to be used with WalletConnect projects. It provides a simple and consistent way to log messages, errors, and other information, making it easier to debug and maintain WalletConnect applications.
Basic Logging
This feature allows you to log messages at different levels (info, warn, error). The logger is instantiated with a context name ('my-app' in this case) to help identify the source of the logs.
const { Logger } = require('@walletconnect/logger');
const logger = new Logger('my-app');
logger.info('This is an info message');
logger.warn('This is a warning message');
logger.error('This is an error message');
Custom Log Levels
This feature allows you to set custom log levels. In this example, the logger is configured to use the 'debug' level, enabling more granular logging.
const { Logger } = require('@walletconnect/logger');
const logger = new Logger('my-app', { level: 'debug' });
logger.debug('This is a debug message');
Log Formatting
This feature allows you to customize the format of the log messages. In this example, the log messages are formatted to include the log level in uppercase.
const { Logger } = require('@walletconnect/logger');
const logger = new Logger('my-app', { format: (level, message) => `[${level.toUpperCase()}] ${message}` });
logger.info('This is a formatted info message');
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP) and log levels. It is highly configurable and can be used for both simple and complex logging needs. Compared to @walletconnect/logger, Winston offers more features and flexibility but may require more setup.
Bunyan is a simple and fast JSON logging library for Node.js. It is designed to produce logs in a structured JSON format, making it easy to parse and analyze. Bunyan is particularly useful for applications that require structured logging. Compared to @walletconnect/logger, Bunyan focuses on JSON output and may be more suitable for applications that need structured logs.
Pino is a low-overhead logging library for Node.js that is designed for high performance. It produces logs in a JSON format and is known for its speed and efficiency. Pino is a good choice for applications that require minimal logging overhead. Compared to @walletconnect/logger, Pino is more performance-oriented and may be better suited for high-throughput applications.
FAQs
Logger Utils
The npm package @walletconnect/logger receives a total of 335,139 weekly downloads. As such, @walletconnect/logger popularity was classified as popular.
We found that @walletconnect/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 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.