From be98292c38709419a09139fb266446e1233f1feb Mon Sep 17 00:00:00 2001 From: Sanskar Atrey Date: Thu, 8 Aug 2024 12:04:56 +0530 Subject: [PATCH] refactor: log event name change --- src/orca-loader/Hyper.res | 2 +- src/orca-log-catcher/OrcaLogger.res | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index 42cb352eb..313ffea84 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -398,7 +398,7 @@ let make = (publishableKey, options: option, analyticsInfo: optionthen(_ => { - logger.setLogInfo(~value=Window.hrefWithoutSearch, ~eventName=ORCA_ELEMENTS_CALLED) + logger.setLogInfo(~value=Window.hrefWithoutSearch, ~eventName=WEB_SDK_IFRAME_MOUNTED) resolve() }) ->ignore diff --git a/src/orca-log-catcher/OrcaLogger.res b/src/orca-log-catcher/OrcaLogger.res index c73c14a04..3c7865fc1 100644 --- a/src/orca-log-catcher/OrcaLogger.res +++ b/src/orca-log-catcher/OrcaLogger.res @@ -39,7 +39,7 @@ type eventName = | APP_REINITIATED | LOG_INITIATED | LOADER_CALLED - | ORCA_ELEMENTS_CALLED + | WEB_SDK_IFRAME_MOUNTED | PAYMENT_OPTIONS_PROVIDED | BLUR | FOCUS @@ -120,7 +120,7 @@ let eventNameToStrMapper = eventName => { | APP_REINITIATED => "APP_REINITIATED" | LOG_INITIATED => "LOG_INITIATED" | LOADER_CALLED => "LOADER_CALLED" - | ORCA_ELEMENTS_CALLED => "ORCA_ELEMENTS_CALLED" + | WEB_SDK_IFRAME_MOUNTED => "WEB_SDK_IFRAME_MOUNTED" | PAYMENT_OPTIONS_PROVIDED => "PAYMENT_OPTIONS_PROVIDED" | BLUR => "BLUR" | FOCUS => "FOCUS" @@ -539,14 +539,17 @@ let make = ( let counter = eventName->calculateAndUpdateCounterHook if GlobalVars.enableLogging && counter <= maxLogsPushedPerEventName { switch loggingLevel { - | DEBUG => log->Array.push(mainLogFile, _)->ignore + | DEBUG => log->(Array.push(mainLogFile, _))->ignore | INFO => [INFO, WARNING, ERROR]->Array.includes(log.logType) - ? log->Array.push(mainLogFile, _)->ignore + ? log->(Array.push(mainLogFile, _))->ignore : () | WARNING => - [WARNING, ERROR]->Array.includes(log.logType) ? log->Array.push(mainLogFile, _)->ignore : () - | ERROR => [ERROR]->Array.includes(log.logType) ? log->Array.push(mainLogFile, _)->ignore : () + [WARNING, ERROR]->Array.includes(log.logType) + ? log->(Array.push(mainLogFile, _))->ignore + : () + | ERROR => + [ERROR]->Array.includes(log.logType) ? log->(Array.push(mainLogFile, _))->ignore : () | SILENT => () } } @@ -594,7 +597,7 @@ let make = ( let checkForPriorityEvents = (arrayOfLogs: array) => { let priorityEventNames = [ APP_RENDERED, - ORCA_ELEMENTS_CALLED, + WEB_SDK_IFRAME_MOUNTED, PAYMENT_DATA_FILLED, PAYMENT_ATTEMPT, CONFIRM_CALL,