pino-global-webhook
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published
Pino Global Webhook
# Pino Global Webhook

If have a webhook then i will send

Use

const url = 'MyWebHook Url';
import { createTransport } from "pino-global-webhook";
const logger = pino(
  createTransport({
    webhooks: [
      url
    ],
  })
);
logger.info("hello world");
logger.warn("hello world");

#Configs

createTransport({
    webhooks: [], //urls
    discord:{
        webhookType: 1, //1| 2| 3 Discord webhook types
        colors:{ //Hexadecimal colors and default colors 
          TRACE: 0x808080, 
          DEBUG: 0x008000,
          INFO: 0x00bfff,
          WARN: 0xffa500,
          ERROR: 0xff4500,
          FATAL: 0xff0000,
          OTHERS: 0x440f3c,
        },
        sameAgent: true, // if you will use a new agent in every webhook
        removeTag:["level"], // Remove a tag from the log
        withWordRemoveTag : "coffe" ,// When find the word will delete the tag
        customTags: [{"mateus":"hello"}] // Add your custom tags from the log :D
    },
    slack:{/* same at discord without "colors" and "webhooktype" */},
    others:{/* same at discord without "colors" and "webhooktype" */},
  })

#Test

Webhook Status
Discord
Slack 🚧
Others 🚧

Package Sidebar

Install

npm i pino-global-webhook

Weekly Downloads

5

Version

1.0.7

License

MIT

Unpacked Size

20.4 kB

Total Files

7

Last publish

Collaborators

  • mateusvieites