Lib JS for generate log on Superlógica log format.
To install the lib just run the command:
npm install @superlogica/super-log-js
Ready!
Now you can use the available interfaces and the adapter.
The most basic possible use is to import default (adapter) and use it, as in the following example:
import { SuperLogAdapter } from '@superlogica/super-log-js';
const superLog = new SuperLogAdapter({
channel: Channel.STDOUT,
application: fakeApplication,
environment: fakeEnvironment
})
superLog.critical({
traceId: 'any-trace-id',
spanId: 'any-span-id',
message: 'any-message'
})
// Or log with tags (max: 3)
superlog.info({
traceId: 'any-trace-id',
spanId: 'any-span-id',
message: 'any-message',
tags: {
tag1: 'any-tag-1',
tag2: 'any-tag-2',
tag3: 'any-tag-3'
}
})