1.0.12 • Published 2 years ago

react-imx-logger v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

IMX LOGGER FOR REACT JS/TS

npm.io

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") 
1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago