1.0.2 • Published 4 years ago

mq-logger v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

What is MQLogger

It is for nodejs

This library is just send query to remote log server (like HTML beacon API)

but if message is unreachable, save message to file and it is loadable next execution

Installation

# yarn
$ yarn add mq-logger
# npm
$ npm install mq-logger

How to Use

General use

import MQLogger from 'mq-logger';

const logger = new MQLogger();

logger.send({any: 'event', you: 'want'}); // return Promise but no need wait

Use GlobalInstance

// if want to use globalInstance
// entry module
import MQLogger from 'mq-logger';

const logger = new MQLogger();

MQLogger.setGlobalInstance(logger);

// another file
const instance = MQLogger.getGlobalInstance();
instance.send(/* ... */);