New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@poap-xyz/poap-logger

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poap-xyz/poap-logger

A logger for POAP

  • 1.5.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
175
increased by78.57%
Maintainers
4
Weekly downloads
 
Created
Source

💻 POAP - Logger📜

Intro

A logger with a simple facade to use in the POAP ecosystem.

Project

This project was built with Typescript.

Usage

Setup

Install from npm repository:

yarn add @poap-xyz/poap-logger

Logger Creation

Example usage with the Fastify onRequest hook:

export default function onRequest(this: FastifyInstance, request: FastifyRequest<any>, response: FastifyReply<any>, done: (err?: Error) => void) {
  const logger = PoapLoggerFactory.createLoggerInstance({
    metadata: {/*METADATA*/}
  });

Where METADATA is a key value pair object where you add the properties you want to log, eg:

metadata: {
    requestId: request.headers["requestid"],
    requestUrl: request.url,
    source: "POAP-Logger-Parent"
}

You can also use getLoggerInstance which will get a logger instance if one is already created or create a new one if not.

PoapLoggerFactory.getLoggerInstance({
  metadata: {/*METADATA*/}
});

Child Loggers

Create a child logger to override or combine parent child metadata:

logger.child({
    moreMetadata1: "More meta", //Will be added
    source: "POAP-Logger-Child" //Will override parent's source prop
});

Logger Types

Coming soon

Logger Transports

Coming soon

Active contributors


Ignacio Negro Caino

💻

Eduardo Sacco

💻

Agustin Lavarello

💻

License

MIT © POAP

FAQs

Package last updated on 19 Jan 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