Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.