@openhps/core
Version:
Open Hybrid Positioning System - Core component
22 lines • 703 B
JavaScript
import { CallbackSinkNode } from './CallbackSinkNode';
/**
* This sink node will serialize the data frames pushed to this
* output layer, and log them to the console using the logging function
* specified in the constructor.
* @category Sink node
*/
export class LoggingSinkNode extends CallbackSinkNode {
/**
* Create a new logger output sink
* @param {Function} loggingFn Logging function
* @param {SinkNodeOptions} options Sink node options
*/
constructor(loggingFn, options) {
super(loggingFn, options);
if (loggingFn === undefined) {
this.callback = frame => {
this.logger('debug', `Received a data frame in node ${this.uid}`, frame);
};
}
}
}