Skip to content

Commit

Permalink
refactor: log event name change
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanskar2001 committed Aug 8, 2024
1 parent 8039a9b commit 5ed201c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/orca-loader/Hyper.res
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ let make = (publishableKey, options: option<JSON.t>, analyticsInfo: option<JSON.
resolve(JSON.Encode.null)
})
->then(_ => {
logger.setLogInfo(~value=Window.hrefWithoutSearch, ~eventName=ORCA_ELEMENTS_CALLED)
logger.setLogInfo(~value=Window.hrefWithoutSearch, ~eventName=WEB_SDK_IFRAME_MOUNTED)
resolve()
})
->ignore
Expand Down
17 changes: 10 additions & 7 deletions src/orca-log-catcher/OrcaLogger.res
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type eventName =
| APP_REINITIATED
| LOG_INITIATED
| LOADER_CALLED
| ORCA_ELEMENTS_CALLED
| WEB_SDK_IFRAME_MOUNTED
| PAYMENT_OPTIONS_PROVIDED
| BLUR
| FOCUS
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 => ()
}
}
Expand Down Expand Up @@ -594,7 +597,7 @@ let make = (
let checkForPriorityEvents = (arrayOfLogs: array<logFile>) => {
let priorityEventNames = [
APP_RENDERED,
ORCA_ELEMENTS_CALLED,
WEB_SDK_IFRAME_MOUNTED,
PAYMENT_DATA_FILLED,
PAYMENT_ATTEMPT,
CONFIRM_CALL,
Expand Down

0 comments on commit 5ed201c

Please sign in to comment.