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.
@probe.gl/log
Advanced tools
@probe.gl/log is a logging utility designed to provide flexible and powerful logging capabilities for JavaScript applications. It offers features such as log levels, formatting, and conditional logging, making it suitable for both development and production environments.
Basic Logging
This feature allows you to create a basic logger instance and log messages at different levels. The 'log' method is used to log messages with a specified log level.
const {Log} = require('@probe.gl/log');
const log = new Log({id: 'my-app'});
log.log('info', 'This is an info message');
Log Levels
This feature allows you to set different log levels to control the verbosity of the logs. Only messages with a level equal to or higher than the set level will be logged.
const {Log} = require('@probe.gl/log');
const log = new Log({id: 'my-app'});
log.level = 1; // Set log level to 1 (error)
log.log(0, 'This is an error message'); // Will be logged
log.log(1, 'This is a warning message'); // Will not be logged
Conditional Logging
This feature allows you to log messages conditionally. The message will only be logged if the specified condition is true.
const {Log} = require('@probe.gl/log');
const log = new Log({id: 'my-app'});
const condition = true;
log.log({message: 'This is a conditional log', condition});
Custom Formatting
This feature allows you to customize the format of the log messages. You can provide a formatting function that will be applied to each log message.
const {Log} = require('@probe.gl/log');
const log = new Log({id: 'my-app', format: (message) => `[${new Date().toISOString()}] ${message}`});
log.log('info', 'This is a formatted message');
Winston is a versatile logging library with support for multiple transports, log levels, and formats. It is highly configurable and widely used in Node.js applications. Compared to @probe.gl/log, Winston offers more advanced features such as custom transports and log rotation.
Bunyan is a simple and fast JSON logging library for Node.js services. It provides a straightforward API for logging and supports log levels, serializers, and streams. Bunyan is similar to @probe.gl/log in terms of simplicity but focuses on JSON output and structured logging.
Pino is a low-overhead logging library for Node.js that emphasizes performance. It provides a fast and efficient way to log messages with support for log levels and custom serializers. Pino is designed for high-performance applications and offers better performance compared to @probe.gl/log.
Logging and instrumentation tools for JavaScript
probe.gl is a collection of logging, instrumentation, bench-marking and test tools for JavaScript applications.
For documentation please visit the website.
v4.0.9
FAQs
JavaScript debug logging for browser and Node
The npm package @probe.gl/log receives a total of 246,353 weekly downloads. As such, @probe.gl/log popularity was classified as popular.
We found that @probe.gl/log demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.