Use global logger in InteractionTracker
Summary: This tracker isn't really used, but at least now it can benefit from having the sessionId. Reviewed By: passy Differential Revision: D13671367 fbshipit-source-id: 3a79e843e3fabab191d0d7471d56a81b1a91a1e9
This commit is contained in:
committed by
Facebook Github Bot
parent
3bcb079f87
commit
7120bf1201
@@ -5,7 +5,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Logger from '../fb-stubs/Logger.js';
|
import {getInstance as getLogger} from '../fb-stubs/Logger';
|
||||||
|
|
||||||
export function reportInteraction(
|
export function reportInteraction(
|
||||||
componentType: string,
|
componentType: string,
|
||||||
@@ -16,7 +16,6 @@ export function reportInteraction(
|
|||||||
}
|
}
|
||||||
|
|
||||||
class InteractionTracker {
|
class InteractionTracker {
|
||||||
static logger = new Logger();
|
|
||||||
static numberOfInteractions = 0;
|
static numberOfInteractions = 0;
|
||||||
|
|
||||||
type: string;
|
type: string;
|
||||||
@@ -29,7 +28,7 @@ class InteractionTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interaction = (name: string, data: any) => {
|
interaction = (name: string, data: any) => {
|
||||||
InteractionTracker.logger.track('usage', 'interaction', {
|
getLogger().track('usage', 'interaction', {
|
||||||
interaction: InteractionTracker.numberOfInteractions++,
|
interaction: InteractionTracker.numberOfInteractions++,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
id: this.id,
|
id: this.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user