You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@web3api/logger-plugin-js

Package Overview
Dependencies
1
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3api/logger-plugin-js

Web3API Javascript Logger Plugin


Version published
Weekly downloads
17
increased by325%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

Web3API 0.0.1-prealpha.45

Features

  • @web3api/tracing-js: Support service name configuration.

Readme

Source

Consoler Logger Plugin

Console Logger plugin implements the w3://ens/logger.core.web3api.eth core Web3API interface. By default it logs all events using the Javascript console module. Different logging mechanisms can be set using the LoggerConfig.

Log levels

  • DEBUG
  • INFO
  • WARN
  • ERROR

Example

import { loggerPlugin, LogLevel } from "@web3api/logger-plugin-js";

const client = new Web3ApiClient({
  plugins: [{
    from: "w3://ens/js-logger.web3api.eth",
    to: loggerPlugin()
  }],
  interfaces: [{
    interface: "w3://ens/logger.core.web3api.eth",
    implementations: ["w3://ens/js-logger.web3api.eth"],
  }]
});

// For custom logging logic, initialize the logger like so:
// loggerPlugin((level: LogLevel, message: string) => { ... })

const response = await client.query<{ log: boolean }>({
  uri: "w3://ens/js-logger.web3api.eth",
  query: `
    query {
      log(
        level: ${LogLevel.INFO}
        message: "Informational message"
      )
    }
  `
});

FAQs

Package last updated on 23 Sep 2021

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc