zl-logs-fe
v1.2.0
Published
"zl activity logs"
Downloads
15
Readme
Installation
npm i zl-logs-fe
Usage
How to send an activity to the activity log using the activity.send() method in React or Node.js application?
Signature:
await new activity(url, enable_auth, auth_token, data).send();
Example 1:
await new activity('http://localhost:3000', false, null, {
source: "string",
source_type: "string",
source_id: "string",
sub_source: "string",
sub_source_id: "string",
event: "string",
unit: "string",
value: "any",
meta: "json",
remarks: "json",
activity_start: "timestamp", // YYYY-MM-DD HH:mm:ss
activity_end: "timestamp",// YYYY-MM-DD HH:mm:ss
}).send();
Example 2
// initiate in singleton object globally accissible
let activity_log = new activity('http://localhost:3000', false, null);
// build and send from anywhere
activity_log.setParams({
source: "string",
source_type: "string",
source_id: "string",
sub_source: "string",
sub_source_id: "string",
event: "string",
unit: "string",
value: "any",
meta: "json",
remarks: "json",
activity_start: "timestamp", // YYYY-MM-DD HH:mm:ss
activity_end: "timestamp",// YYYY-MM-DD HH:mm:ss
}).send();