Skip to content

Commit f2cf32d

Browse files
committed
change log levels
1 parent 53283e8 commit f2cf32d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

ndk/lib/src/androidTest/jni/ndk-test.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_crash(JNIEnv *env, jc
1313
}
1414

1515
JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_message(JNIEnv *env, jclass cls) {
16-
__android_log_print(ANDROID_LOG_WARN, TAG, "Sending message.");
16+
__android_log_print(ANDROID_LOG_INFO, TAG, "Sending message.");
1717
sentry_value_t event = sentry_value_new_message_event(
1818
/* level */ SENTRY_LEVEL_INFO,
1919
/* logger */ "custom",
@@ -23,7 +23,7 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_message(JNIEnv *env,
2323
}
2424

2525
JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_transaction(JNIEnv *env, jclass cls) {
26-
__android_log_print(ANDROID_LOG_WARN, TAG, "Sending transaction.");
26+
__android_log_print(ANDROID_LOG_INFO, TAG, "Sending transaction.");
2727

2828
sentry_transaction_context_t *tx_ctx
2929
= sentry_transaction_context_new("little.teapot",
@@ -44,7 +44,12 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_transaction(JNIEnv *e
4444
child, "span_data_says", sentry_value_new_string("hi!"));
4545
sentry_span_finish(grandchild);
4646
sentry_span_finish(child);
47-
sentry_transaction_finish(tx);
47+
sentry_uuid_s uuid = sentry_transaction_finish(tx);
48+
if(sentry_uuid_is_nil(&uuid)) {
49+
__android_log_print(ANDROID_LOG_WARN, TAG, "Transaction was not sent.");
50+
} else {
51+
__android_log_print(ANDROID_LOG_INFO, TAG, "Transaction sent.");
4852

53+
}
4954
}
5055
}

ndk/sample/src/main/cpp/ndk-sample.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_crash(JNIEnv *env, jc
1313
}
1414

1515
JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_message(JNIEnv *env, jclass cls) {
16-
__android_log_print(ANDROID_LOG_WARN, TAG, "Sending message.");
16+
__android_log_print(ANDROID_LOG_INFO, TAG, "Sending message.");
1717
sentry_value_t event = sentry_value_new_message_event(
1818
/* level */ SENTRY_LEVEL_INFO,
1919
/* logger */ "custom",
@@ -23,7 +23,7 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_message(JNIEnv *env,
2323
}
2424

2525
JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_transaction(JNIEnv *env, jclass cls) {
26-
__android_log_print(ANDROID_LOG_WARN, TAG, "Sending transaction.");
26+
__android_log_print(ANDROID_LOG_INFO, TAG, "Sending transaction.");
2727

2828
sentry_transaction_context_t *tx_ctx
2929
= sentry_transaction_context_new("little.teapot",
@@ -46,9 +46,9 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_transaction(JNIEnv *e
4646
sentry_span_finish(child);
4747
sentry_uuid_s uuid = sentry_transaction_finish(tx);
4848
if(sentry_uuid_is_nil(&uuid)) {
49-
__android_log_print(ANDROID_LOG_WARN, TAG, "Transaction failed to send.");
49+
__android_log_print(ANDROID_LOG_WARN, TAG, "Transaction was not sent.");
5050
} else {
51-
__android_log_print(ANDROID_LOG_WARN, TAG, "Transaction sent.");
51+
__android_log_print(ANDROID_LOG_INFO, TAG, "Transaction sent.");
5252

5353
}
5454

0 commit comments

Comments
 (0)