Skip to content

Commit

Permalink
refactor the try catch for failing to load logger (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaszurkan-optimizely authored Apr 23, 2019
1 parent e1be6e2 commit c4bb4f9
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -734,23 +734,13 @@ public Builder withDatafileConfig(DatafileConfig datafileConfig) {
public OptimizelyManager build(Context context) {
if (logger == null) {
try {
logger = LoggerFactory.getLogger(OptimizelyManager.class);
logger = LoggerFactory.getLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
} catch (Exception e) {
try {
logger = LoggerFactory.getLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
}
catch (Exception e1) {
logger = new OptimizelyLiteLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
}
logger = new OptimizelyLiteLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
logger.error("Unable to generate logger from class.", e);
} catch (Error e) {
try {
logger = LoggerFactory.getLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
logger.error("Unable to generate logger from class.", e);
}
catch (Exception e1) {
logger = new OptimizelyLiteLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
}
logger = new OptimizelyLiteLogger("com.optimizely.ab.android.sdk.OptimizelyManager");
logger.error("Unable to generate logger from class.", e);
}
}

Expand Down

0 comments on commit c4bb4f9

Please sign in to comment.