session-ios/Signal/src/util/OWSAnalytics.swift
nielsandriesse 74bbe067d8 Update Pods
2020-06-05 10:38:44 +10:00

22 lines
845 B
Swift

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import Foundation
import SessionServiceKit
func FormatAnalyticsLocation(file: String, function: String) -> NSString {
return "\((file as NSString).lastPathComponent):\(function)" as NSString
}
func OWSProdError(_ eventName: String, file: String, function: String, line: Int32) {
let location = FormatAnalyticsLocation(file: file, function: function)
OWSAnalytics
.logEvent(eventName, severity: .error, parameters: nil, location: location.utf8String!, line:line)
}
func OWSProdInfo(_ eventName: String, file: String, function: String, line: Int32) {
let location = FormatAnalyticsLocation(file: file, function: function)
OWSAnalytics
.logEvent(eventName, severity: .info, parameters: nil, location: location.utf8String!, line:line)
}