Skip to content

Commit 6677212

Browse files
jaeoptthomaszurkan-optimizely
authored andcommitted
(chore): Add debugLevel setting into sample codes (JIRA-4729) (#196)
* add debugLevel setting into sample codes * change logLevel to debug for sample codes
1 parent e0d87ac commit 6677212

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

DemoObjCApp/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ -(void)initializeOptimizelySDKWithCustomization {
109109
eventDispatcher:nil
110110
userProfileService:nil
111111
periodicDownloadInterval:customDownloadIntervalInSecs
112-
defaultLogLevel:OptimizelyLogLevelInfo];
112+
defaultLogLevel:OptimizelyLogLevelDebug];
113113

114114
NSNumber *notifId;
115115
notifId = [self.optimizely.notificationCenter addDecisionNotificationListenerWithDecisionListener:^(NSString *type,

DemoSwiftApp/AppDelegate.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5454
// MARK: - Initialization Examples
5555

5656
func initializeOptimizelySDKAsynchronous() {
57-
optimizely = OptimizelyClient(sdkKey: sdkKey)
58-
var handler = optimizely.datafileHandler
59-
handler.endPointStringFormat = "https://cdn.optimizely.com/datafiles/%@.json"
57+
optimizely = OptimizelyClient(sdkKey: sdkKey, defaultLogLevel: .debug)
6058

6159
optimizely.start { result in
6260
switch result {
@@ -74,8 +72,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7472
guard let localDatafilePath = Bundle.main.path(forResource: datafileName, ofType: "json") else {
7573
fatalError("Local datafile cannot be found")
7674
}
77-
78-
optimizely = OptimizelyClient(sdkKey: sdkKey)
75+
76+
optimizely = OptimizelyClient(sdkKey: sdkKey, defaultLogLevel: .debug)
7977

8078
do {
8179
let datafileJSON = try String(contentsOfFile: localDatafilePath, encoding: .utf8)
@@ -98,8 +96,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
9896

9997
optimizely = OptimizelyClient(sdkKey: sdkKey,
10098
logger: customLogger,
101-
periodicDownloadInterval: customDownloadIntervalInSecs)
102-
99+
periodicDownloadInterval: customDownloadIntervalInSecs,
100+
defaultLogLevel: .debug)
103101
// notification listeners
104102

105103
_ = optimizely.notificationCenter.addDecisionNotificationListener(decisionListener: { (type, userId, attributes, decisionInfo) in

0 commit comments

Comments
 (0)