public final class SentryEnvironment extends Object
Manages information related to Sentry Runtime such as the name of the library or whether or not the thread is managed by Sentry.
Modifier and Type | Field and Description |
---|---|
static String |
SDK_NAME
Name of this SDK.
|
static String |
SDK_VERSION
Version of this SDK.
|
protected static ThreadLocal<AtomicInteger> |
SENTRY_THREAD
Indicates whether the current thread is managed by sentry or not.
|
Modifier and Type | Method and Description |
---|---|
static String |
getSentryName()
Returns sdk name+version string, used for HTTP User Agent, sentry_client, etc.
|
static boolean |
isManagingThread()
Checks whether the current thread is managed by Sentry or not.
|
static void |
startManagingThread()
Sets the current thread as managed by Sentry.
|
static void |
stopManagingThread()
Sets the current thread as not managed by Sentry.
|
public static final String SDK_NAME
public static final String SDK_VERSION
protected static final ThreadLocal<AtomicInteger> SENTRY_THREAD
public static void startManagingThread()
The logs generated by Threads managed by Sentry will not send logs to Sentry.
Recommended usage:
SentryEnvironment.startManagingThread();
try {
// Some code that shouldn't generate Sentry logs.
} finally {
SentryEnvironment.stopManagingThread();
}
public static void stopManagingThread()
The logs generated by Threads not managed by Sentry will send logs to Sentry.
public static boolean isManagingThread()
true
if the thread is managed by Sentry, false
otherwise.public static String getSentryName()
Copyright © 2012–2017. All rights reserved.