Skip to content

Commit

Permalink
console: Report command success or failure in debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Dec 3, 2024
1 parent 510bbfc commit bc8329d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,22 @@ void console_handle_line(game_state *gs) {
console_output_add("> ");
console_output_add(argv[0]);
console_output_addline(" SUCCESS");
DEBUG("Console command %s succeeded", argv[0]);
} else {
char buf[12];
snprintf(buf, 12, "%d", err);
console_output_add("> ");
console_output_add(argv[0]);
console_output_add(" ERROR:");
console_output_addline(buf);
DEBUG("Error in console command %s: %s", argv[0], buf);
}
console_add_history(input_copy, sizeof(input_copy));
} else {
console_output_add("> ");
console_output_add(argv[0]);
console_output_addline(" NOT RECOGNIZED");
DEBUG("Console command %s not recognized", argv[0]);
}
omf_free(argv);
} else {
Expand Down

0 comments on commit bc8329d

Please sign in to comment.