Skip to content

Commit

Permalink
Fix debug logs (kstenerud#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
bamx23 authored Oct 11, 2024
1 parent 00ca0b0 commit c97aa04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Sources/KSCrashRecording/KSCrashReportStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ - (void)sendAllReportsWithCompletion:(KSCrashReportFilterCompletion)onCompletion
__weak __typeof(self) weakSelf = self;
[self sendReports:reports
onCompletion:^(NSArray *filteredReports, NSError *error) {
KSLOG_DEBUG(@"Process finished with completion: %d", completed);
KSLOG_DEBUG(@"Process finished");
if (error != nil) {
KSLOG_ERROR(@"Failed to send reports: %@", error);
}
Expand Down
22 changes: 11 additions & 11 deletions Sources/KSCrashRecordingCore/KSCrashMonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ typedef struct {

#define INITIAL_MONITOR_CAPACITY 15

#pragma mark - Helpers

__attribute__((unused)) // Suppress unused function warnings, especially in release builds.
static inline const char *
getMonitorNameForLogging(const KSCrashMonitorAPI *api)
{
return kscm_getMonitorId(api) ?: "Unknown";
}

// ============================================================================
#pragma mark - Globals -
// ============================================================================
Expand Down Expand Up @@ -96,13 +105,13 @@ static void removeMonitor(MonitorList *list, const KSCrashMonitorAPI *api)
list->count--;
list->apis[list->count] = NULL;

KSLOG_DEBUG("Monitor %s removed from the list.", getMonitorNameForLogging(func));
KSLOG_DEBUG("Monitor %s removed from the list.", getMonitorNameForLogging(api));
break;
}
}

if (!found) {
KSLOG_DEBUG("Monitor %s not found in the list. No removal performed.", getMonitorNameForLogging(func));
KSLOG_DEBUG("Monitor %s not found in the list. No removal performed.", getMonitorNameForLogging(api));
}
}

Expand All @@ -126,15 +135,6 @@ void kscm_resetState(void)
g_onExceptionEvent = NULL;
}

#pragma mark - Helpers

__attribute__((unused)) // Suppress unused function warnings, especially in release builds.
static inline const char *
getMonitorNameForLogging(const KSCrashMonitorAPI *api)
{
return kscm_getMonitorId(api) ?: "Unknown";
}

// ============================================================================
#pragma mark - API -
// ============================================================================
Expand Down

0 comments on commit c97aa04

Please sign in to comment.