šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

react-imx-logger

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-imx-logger

Imaxeam logger for react

1.0.12
latest
Source
npm
Version published
Weekly downloads
15
275%
Maintainers
1
Weekly downloads
Ā 
Created
Source

IMX LOGGER FOR REACT JS/TS

Installation

Step1

yarn add react-imx-logger

or

npm i react-imx-logger

Usage

MAKE SURE TO ENABLE STOMP PLUGIN IN RABBIT MQ

Create connection and connect

mport { imxNodeLogger } from "node-imx-logger";

  imxReactLogger.createMqConnectionOverWS(
            {
              host: "ws://127.0.0.1:15674/ws",
              login: "login_example",
              password: "password_example",
            },
            {
              connectCallback(frame) {
                console.log("frame");
              },
            },
            "queue_name_example",
            "app_name_example",
            {
              enableDebug: true,
              enableErrors: true,
            }
          );

Now you can use or import the imxReactLogger everywhere in the app with default existing methods by @StompClient here .

To send debug logs use :
    imxReactLogger.debug({
            context: "react_example",
            message: "hello from react example ",
          });
To send errors logs use :
imxReactLogger.error({
        context: "react_example",
        message: "hello from react example ",
      });
To disconnect :
imxReactLogger?.disconnect(() => {
            console.log("disconnected");
          });
To disble DEBUG logging :
  imxReactLogger?.disableDebugLogging();
To disble ERRORS logging :
  imxReactLogger?.disableErrorLogging();
To enable DEBUG logging :
  imxReactLogger?.enableDebugLogging();
To enable ERRORS logging :
  imxReactLogger?.enableErrorLogging();
To check logging status :
   imxReactLogger.checkLoggingStatus() 
     // return {
      //  errorLoggingStatus: bool,
       // debugLoggingStatus: bool,
      // };


    imxReactLogger.checkErrorLoggingStatus() //return bool

    imxReactLogger.checkDebugLoggingStatus() // return bool
To change APP NAME inside the code after connect :
  imxReactLogger.setAppName("example_app") 

Keywords

mqtt

FAQs

Package last updated on 05 Jun 2023

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