-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding App Center Logging Destination
- Loading branch information
1 parent
615a241
commit d866af5
Showing
6 changed files
with
93 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// Created by Brenner Ryan on 5/11/21. | ||
// Copyright (c) 2021 Okta, Inc. All rights reserved. | ||
// | ||
|
||
import AppCenterAnalytics | ||
|
||
/** | ||
Concrete logging class for App Center events. | ||
*/ | ||
class AppCenterLogger: OktaLoggerDestinationBase { | ||
override open func log(level: OktaLoggerLogLevel, eventName: String, message: String?, properties: [AnyHashable: Any]?, file: String, line: NSNumber, funcName: String) { | ||
switch level { | ||
case .error: | ||
guard let propertiesStrings = properties as? [String: String] else { | ||
Analytics.trackEvent(eventName) | ||
return | ||
} | ||
Analytics.trackEvent(eventName, withProperties: propertiesStrings, flags: .critical) | ||
default: | ||
guard let propertiesStrings = properties as? [String: String] else { | ||
Analytics.trackEvent(eventName) | ||
return | ||
} | ||
Analytics.trackEvent(eventName, withProperties: propertiesStrings) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters