You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lots of (maybe all) times we are doing an analytics event we ALSO want to be logging something. We should tweak the analytics tracking so that it can automatically log the analytics events in some way as well.
Minimally, any analytics call should also (by default) cause the analytics event to get logged to the verbose logging level (though maybe there should be a way to turn this behaviour of globally and/or for a particular track call).
It might also be worth having some approach that we can easily log a warning/error and an analytics event in a single call. This could be either changing the analytics tracking method to take a log level (clog.track(id: "purchaseFailed", log: .warning)), change the warn/error methods to take a flag to enable analytics (clog.error("purchaseFailed", analytics:true)) or add some new methods specifically for this (clog.trackError("purchaseFailed")).
I think I mildly prefer the first option (analytics methods that takes a log level). It looks the cleanest to me, doesn't have the issue the other two do of maybe ending up with "bad" analytics events names if people are using normal log text as the event name, and has the nice advantage of also providing a reasonable way to turn off the default logging for a particular call with the same signature (clog.track(id: "eventWeDontWantToLog", log: .none))
The text was updated successfully, but these errors were encountered:
Lots of (maybe all) times we are doing an analytics event we ALSO want to be logging something. We should tweak the analytics tracking so that it can automatically log the analytics events in some way as well.
Minimally, any analytics call should also (by default) cause the analytics event to get logged to the
verbose
logging level (though maybe there should be a way to turn this behaviour of globally and/or for a particular track call).It might also be worth having some approach that we can easily log a warning/error and an analytics event in a single call. This could be either changing the analytics tracking method to take a log level (
clog.track(id: "purchaseFailed", log: .warning)
), change the warn/error methods to take a flag to enable analytics (clog.error("purchaseFailed", analytics:true)
) or add some new methods specifically for this (clog.trackError("purchaseFailed")
).I think I mildly prefer the first option (analytics methods that takes a log level). It looks the cleanest to me, doesn't have the issue the other two do of maybe ending up with "bad" analytics events names if people are using normal log text as the event name, and has the nice advantage of also providing a reasonable way to turn off the default logging for a particular call with the same signature (
clog.track(id: "eventWeDontWantToLog", log: .none)
)The text was updated successfully, but these errors were encountered: