Skip to content

Commit

Permalink
Add some more temporary debug logging
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Feb 14, 2024
1 parent a6e48e2 commit 5b344e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,19 @@ int api_history_clients(struct ftl_conn *api)
temparray[2*clientID + 1] = client->count;
}

// Print content of the array *before* sorting
log_info("Unsorted array:");
for(int i = 0; i < counters->clients; i++)
log_info(" %d: %d", temparray[2*i + 0], temparray[2*i + 1]);

// Sort temporary array
qsort(temparray, counters->clients, sizeof(int[2]), cmpdesc);

// Print content of the array *after* sorting
log_info("Sorted array:");
for(int i = 0; i < counters->clients; i++)
log_info(" %d: %d", temparray[2*i + 0], temparray[2*i + 1]);

// Main return loop
int others_total = 0;
cJSON *history = JSON_NEW_ARRAY();
Expand Down

0 comments on commit 5b344e9

Please sign in to comment.