Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix):refactor the try catch for failing to load logger #270

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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