Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@changesets/logger
Advanced tools
@changesets/logger is a logging utility designed to be used with the Changesets tool. It provides a simple and consistent way to log messages, warnings, and errors during the process of managing versioning and changelogs for a monorepo or multi-package repository.
Logging Info Messages
This feature allows you to log informational messages. The `info` function is used to log messages that are meant to inform the user about the current state or progress of a process.
const { info } = require('@changesets/logger');
info('This is an info message');
Logging Warning Messages
This feature allows you to log warning messages. The `warn` function is used to log messages that indicate a potential issue or something that the user should be cautious about.
const { warn } = require('@changesets/logger');
warn('This is a warning message');
Logging Error Messages
This feature allows you to log error messages. The `error` function is used to log messages that indicate a failure or critical issue that needs immediate attention.
const { error } = require('@changesets/logger');
error('This is an error message');
Logging Success Messages
This feature allows you to log success messages. The `success` function is used to log messages that indicate a successful operation or completion of a task.
const { success } = require('@changesets/logger');
success('This is a success message');
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 @changesets/logger, offering advanced logging capabilities such as log levels, custom formats, and more.
Pino is a fast and low-overhead logging library for Node.js. It is designed for high-performance logging and is suitable for production environments. Compared to @changesets/logger, Pino offers better performance and more advanced features like log redaction and serializers.
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 logs. Bunyan offers more advanced features than @changesets/logger, such as log streams and child loggers.
import { error } from '@changesets/logger";
error('message part 1', 'message part 2');
error: Use error
to print error messages upon which users which immediately action to complete the task.
info: Use info
to print informational messages to user.
log: Use log
to print messages don't fall in any other specific category. For example, message to show title of the step being performed by the changesets tool.
success: Use success
to assert to users that their instructions have completed successfully.
warn: Use warn
to print warning messages, something that user could action on now or later without much impact of their work.
Use the @changesets/test-utils
package to silence the logs in test cases.
For example:
import { temporarilySilenceLogs } from "@changesets/test-utils";
import { log } from "@changesets/logger";
temporarilySilenceLogs();
// Now the logs in this test file are not actually logged to std out
log("I am not logged");
// Use console.log to log messages in tests if required
console.log("Yay, I am logged");
FAQs
Console log alias
We found that @changesets/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.