import { IAnalytics , IAnalyticsUser , IEventArgs , IPageEvent , TraitsMap , UserIdentificationStr } from "../IAnalytics" ; const ENABLED = typeof localStorage !== 'undefined' && localStorage . getItem ( 'analytics.tracing' ) === 'true' ; function doTrace ( eventName , data ) { if ( ENABLED ) { console . log ( "analytics: " + eventName , data || { } ) ; } } export class ConsoleAnalytics implements IAnalytics { public constructor ( ) { } public event ( evt ) { doTrace ( "event" , evt ) ; } public event2 ( event , data ? ) { doTrace ( "event2:" + event , data || { } ) ; } public page ( event ) { doTrace ( "page" , event ) ; } public identify ( user ) { doTrace ( "identify" , user ) ; } public traits ( traitsMap ) { doTrace ( "traits" , traitsMap ) ; } public version ( version ) { } public heartbeat ( ) { } public logout ( ) { } }