Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@probe.gl/log

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@probe.gl/log

JavaScript debug logging for browser and Node

  • 4.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
305K
increased by15.23%
Maintainers
3
Weekly downloads
 
Created

What is @probe.gl/log?

@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.

What are @probe.gl/log's main functionalities?

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');

Other packages similar to @probe.gl/log

Keywords

FAQs

Package last updated on 09 Mar 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc