@salesduck/transport-logs
v4.1.0
Published
Allows you to develop your own transport
Downloads
81
Readme
Transport
Abstraction for sending log data to consumers
Setup
Install package
yarn add @salesduck/transport-logs
Usage
You can develop a new transport
Any transport must implement the method log
, which will send the field MESSAGE
to the consumer
import { FormatterLogMessage, MESSAGE } from '@salesduck/symbols-logs';
import { Transport } from '@salesduck/transport-logs';
export class MyTransport extends Transport {
log(message: FormatterLogMessage): void {
// NOTE: Abstract native sdk, for example Android
NativeSDK.captureLog(message[MESSAGE]);
}
}