Skip to content

Commit

Permalink
applied feedback changing log macros
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMoelans committed Dec 19, 2024
1 parent 40fc9a8 commit 89e7cea
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/backends/sentry_backend_crashpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ crashpad_backend_flush_scope_to_event(const sentry_path_t *event_path,
sentry_free(mpack);

if (rv != 0) {
SENTRY_INFO("flushing scope to msgpack failed");
SENTRY_WARN("flushing scope to msgpack failed");
}
}

Expand Down Expand Up @@ -545,7 +545,7 @@ crashpad_backend_add_breadcrumb(sentry_backend_t *backend,
sentry_free(mpack);

if (rv != 0) {
SENTRY_INFO("flushing breadcrumb to msgpack failed");
SENTRY_WARN("flushing breadcrumb to msgpack failed");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/path/sentry_path_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ write_buffer_with_flags(
int fd = open(
path->path, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
if (fd < 0) {
SENTRY_DEBUGF(
SENTRY_WARN(
"failed to open file \"%s\" for writing (errno %d, flags %x)",
path->path, errno, flags);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/path/sentry_path_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ sentry__path_current_exe(void)
sentry_path_t *path = path_with_len(MAX_PATH);
size_t len = GetModuleFileNameW(NULL, path->path, MAX_PATH);
if (!len) {
SENTRY_INFO("unable to get current exe path");
SENTRY_WARN("unable to get current exe path");
sentry__path_free(path);
return NULL;
}
Expand Down
26 changes: 13 additions & 13 deletions src/sentry_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ sentry_init(sentry_options_t *options)
if (options->database_path) {
sentry__path_free(database_path);
} else {
SENTRY_INFO("falling back to non-absolute database path");
SENTRY_DEBUG("falling back to non-absolute database path");
options->database_path = database_path;
}
SENTRY_INFOF("using database path \"%" SENTRY_PATH_PRI "\"",
Expand Down Expand Up @@ -262,7 +262,7 @@ sentry_close(void)
}
sentry_options_free(options);
} else {
SENTRY_INFO("sentry_close() called, but options was empty");
SENTRY_WARN("sentry_close() called, but options was empty");
}

g_options = NULL;
Expand Down Expand Up @@ -363,7 +363,7 @@ sentry__capture_envelope(
{
bool has_consent = !sentry__should_skip_upload();
if (!has_consent) {
SENTRY_DEBUG("discarding envelope due to missing user consent");
SENTRY_INFO("discarding envelope due to missing user consent");
sentry_envelope_free(envelope);
return;
}
Expand Down Expand Up @@ -906,7 +906,7 @@ sentry_transaction_finish_ts(
sentry_transaction_t *opaque_tx, uint64_t timestamp)
{
if (!opaque_tx || sentry_value_is_null(opaque_tx->inner)) {
SENTRY_INFO("no transaction available to finish");
SENTRY_WARN("no transaction available to finish");
goto fail;
}

Expand Down Expand Up @@ -1029,7 +1029,7 @@ sentry_transaction_start_child_ts_n(sentry_transaction_t *opaque_parent,
size_t description_len, const uint64_t timestamp)
{
if (!opaque_parent || sentry_value_is_null(opaque_parent->inner)) {
SENTRY_INFO("no transaction available to create a child under");
SENTRY_WARN("no transaction available to create a child under");
return NULL;
}
sentry_value_t parent = opaque_parent->inner;
Expand Down Expand Up @@ -1079,11 +1079,11 @@ sentry_span_start_child_ts_n(sentry_span_t *opaque_parent,
size_t description_len, uint64_t timestamp)
{
if (!opaque_parent || sentry_value_is_null(opaque_parent->inner)) {
SENTRY_INFO("no parent span available to create a child span under");
SENTRY_WARN("no parent span available to create a child span under");
return NULL;
}
if (!opaque_parent->transaction) {
SENTRY_INFO("no root transaction to create a child span under");
SENTRY_WARN("no root transaction to create a child span under");
return NULL;
}
sentry_value_t parent = opaque_parent->inner;
Expand Down Expand Up @@ -1121,14 +1121,14 @@ void
sentry_span_finish_ts(sentry_span_t *opaque_span, uint64_t timestamp)
{
if (!opaque_span || sentry_value_is_null(opaque_span->inner)) {
SENTRY_INFO("no span to finish");
SENTRY_WARN("no span to finish");
goto fail;
}

sentry_transaction_t *opaque_root_transaction = opaque_span->transaction;
if (!opaque_root_transaction
|| sentry_value_is_null(opaque_root_transaction->inner)) {
SENTRY_INFO(
SENTRY_WARN(
"no root transaction to finish span on, aborting span finish");
goto fail;
}
Expand All @@ -1143,7 +1143,7 @@ sentry_span_finish_ts(sentry_span_t *opaque_span, uint64_t timestamp)

if (!sentry_value_is_null(
sentry_value_get_by_key(root_transaction, "timestamp"))) {
SENTRY_INFO("span's root transaction is already finished, aborting "
SENTRY_WARN("span's root transaction is already finished, aborting "
"span finish");
goto fail;
}
Expand Down Expand Up @@ -1175,7 +1175,7 @@ sentry_span_finish_ts(sentry_span_t *opaque_span, uint64_t timestamp)
}

if (!sentry_value_is_null(sentry_value_get_by_key(span, "timestamp"))) {
SENTRY_INFO("span is already finished, aborting span finish");
SENTRY_WARN("span is already finished, aborting span finish");
sentry_value_decref(span);
goto fail;
}
Expand All @@ -1193,7 +1193,7 @@ sentry_span_finish_ts(sentry_span_t *opaque_span, uint64_t timestamp)
sentry_value_t spans = sentry_value_get_by_key(root_transaction, "spans");

if (sentry_value_get_length(spans) >= max_spans) {
SENTRY_INFO("reached maximum number of spans for transaction, "
SENTRY_WARN("reached maximum number of spans for transaction, "
"discarding span");
sentry_value_decref(span);
goto fail;
Expand Down Expand Up @@ -1260,7 +1260,7 @@ sentry_capture_minidump_n(const char *path, size_t path_len)
return;
}

SENTRY_INFOF(
SENTRY_DEBUGF(
"Capturing minidump \"%" SENTRY_PATH_PRI "\"", dump_path->path);

sentry_value_t event = sentry_value_new_event();
Expand Down
8 changes: 4 additions & 4 deletions src/sentry_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sentry__run_write_envelope(
sentry__path_free(output_path);

if (rv) {
SENTRY_INFO("writing envelope to file failed");
SENTRY_WARN("writing envelope to file failed");
}

// the `write_to_path` returns > 0 on failure, but we would like a real bool
Expand All @@ -131,7 +131,7 @@ sentry__run_write_session(
sentry_free(buf);

if (rv) {
SENTRY_INFO("writing session to file failed");
SENTRY_WARN("writing session to file failed");
}
return !rv;
}
Expand Down Expand Up @@ -266,7 +266,7 @@ sentry__write_crash_marker(const sentry_options_t *options)
sentry__path_free(marker_path);

if (rv) {
SENTRY_INFO("writing crash timestamp to file failed");
SENTRY_WARN("writing crash timestamp to file failed");
}
return !rv;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ sentry__clear_crash_marker(const sentry_options_t *options)
int rv = sentry__path_remove(marker_path);
sentry__path_free(marker_path);
if (rv) {
SENTRY_INFO("removing the crash timestamp file has failed");
SENTRY_WARN("removing the crash timestamp file has failed");
}
return !rv;
}
4 changes: 2 additions & 2 deletions src/sentry_tracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ sentry__value_span_new_n(size_t max_spans, sentry_value_t parent,
sentry_slice_t operation, sentry_slice_t description, uint64_t timestamp)
{
if (!sentry_value_is_null(sentry_value_get_by_key(parent, "timestamp"))) {
SENTRY_INFO("span's parent is already finished, not creating span");
SENTRY_WARN("span's parent is already finished, not creating span");
goto fail;
}

Expand All @@ -368,7 +368,7 @@ sentry__value_span_new_n(size_t max_spans, sentry_value_t parent,
// number of max spans. This means that the number of in-flight spans
// can exceed the max number of spans.
if (sentry_value_get_length(spans) >= max_spans) {
SENTRY_INFO("reached maximum number of spans for transaction, not "
SENTRY_WARN("reached maximum number of spans for transaction, not "
"creating span");
goto fail;
}
Expand Down
6 changes: 3 additions & 3 deletions src/sentry_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sentry__transport_send_envelope(
return;
}
if (!transport) {
SENTRY_DEBUG("discarding envelope due to invalid transport");
SENTRY_WARN("discarding envelope due to invalid transport");
sentry_envelope_free(envelope);
return;
}
Expand Down Expand Up @@ -175,7 +175,7 @@ gzipped_with_compression(const char *body, const size_t body_len,
int err = deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
MAX_WBITS + 16, 9, Z_DEFAULT_STRATEGY);
if (err != Z_OK) {
SENTRY_DEBUGF("deflateInit2 failed: %d", err);
SENTRY_WARNF("deflateInit2 failed: %d", err);
return false;
}

Expand All @@ -193,7 +193,7 @@ gzipped_with_compression(const char *body, const size_t body_len,
}

if (err != Z_STREAM_END) {
SENTRY_DEBUGF("deflate failed: %d", err);
SENTRY_WARNF("deflate failed: %d", err);
sentry_free(buffer);
buffer = NULL;
deflateEnd(&stream);
Expand Down
2 changes: 1 addition & 1 deletion src/transports/sentry_transport_winhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ sentry__winhttp_send_task(void *_envelope, void *_state)
sentry__rate_limiter_update_from_429(state->ratelimiter);
}
} else {
SENTRY_INFOF(
SENTRY_WARNF(
"`WinHttpSendRequest` failed with code `%d`", GetLastError());
}

Expand Down

0 comments on commit 89e7cea

Please sign in to comment.