This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f01ab69
commit 1283118
Showing
6 changed files
with
158 additions
and
15 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
132 changes: 132 additions & 0 deletions
132
sentry-core/src/main/java/io/sentry/core/HubAdapter.java
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,132 @@ | ||
package io.sentry.core; | ||
|
||
import io.sentry.core.protocol.SentryId; | ||
import io.sentry.core.protocol.User; | ||
import java.util.List; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public final class HubAdapter implements IHub { | ||
|
||
private static final HubAdapter INSTANCE = new HubAdapter(); | ||
|
||
private HubAdapter() {} | ||
|
||
public static HubAdapter getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return Sentry.isEnabled(); | ||
} | ||
|
||
@Override | ||
public SentryId captureEvent(SentryEvent event, @Nullable Object hint) { | ||
return Sentry.captureEvent(event, hint); | ||
} | ||
|
||
@Override | ||
public SentryId captureMessage(String message, SentryLevel level) { | ||
return Sentry.captureMessage(message, level); | ||
} | ||
|
||
@Override | ||
public SentryId captureException(Throwable throwable, @Nullable Object hint) { | ||
return Sentry.captureException(throwable, hint); | ||
} | ||
|
||
@Override | ||
public void close() { | ||
Sentry.close(); | ||
} | ||
|
||
@Override | ||
public void addBreadcrumb(Breadcrumb breadcrumb, @Nullable Object hint) { | ||
Sentry.addBreadcrumb(breadcrumb, hint); | ||
} | ||
|
||
@Override | ||
public void setLevel(SentryLevel level) { | ||
Sentry.setLevel(level); | ||
} | ||
|
||
@Override | ||
public void setTransaction(String transaction) { | ||
Sentry.setTransaction(transaction); | ||
} | ||
|
||
@Override | ||
public void setUser(User user) { | ||
Sentry.setUser(user); | ||
} | ||
|
||
@Override | ||
public void setFingerprint(List<String> fingerprint) { | ||
Sentry.setFingerprint(fingerprint); | ||
} | ||
|
||
@Override | ||
public void clearBreadcrumbs() { | ||
Sentry.clearBreadcrumbs(); | ||
} | ||
|
||
@Override | ||
public void setTag(String key, String value) { | ||
Sentry.setTag(key, value); | ||
} | ||
|
||
@Override | ||
public void removeTag(String key) { | ||
Sentry.removeTag(key); | ||
} | ||
|
||
@Override | ||
public void setExtra(String key, String value) { | ||
Sentry.setExtra(key, value); | ||
} | ||
|
||
@Override | ||
public void removeExtra(String key) { | ||
Sentry.removeExtra(key); | ||
} | ||
|
||
@Override | ||
public SentryId getLastEventId() { | ||
return Sentry.getLastEventId(); | ||
} | ||
|
||
@Override | ||
public void pushScope() { | ||
Sentry.pushScope(); | ||
} | ||
|
||
@Override | ||
public void popScope() { | ||
Sentry.popScope(); | ||
} | ||
|
||
@Override | ||
public void withScope(ScopeCallback callback) { | ||
Sentry.withScope(callback); | ||
} | ||
|
||
@Override | ||
public void configureScope(ScopeCallback callback) { | ||
Sentry.configureScope(callback); | ||
} | ||
|
||
@Override | ||
public void bindClient(ISentryClient client) { | ||
Sentry.bindClient(client); | ||
} | ||
|
||
@Override | ||
public void flush(long timeoutMills) { | ||
Sentry.flush(timeoutMills); | ||
} | ||
|
||
@Override | ||
public IHub clone() { | ||
return Sentry.getCurrentHub().clone(); | ||
} | ||
} |
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