From: Hugo Villeneuve Date: Sun, 24 Nov 2013 18:11:27 +0000 (-0500) Subject: Replace printf statements with log functions X-Git-Tag: v2.0.0~69 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=18b62c73db9c950d5bec10a77de999a633314c1d;p=emu8051.git Replace printf statements with log functions --- diff --git a/src/emuconsole.c b/src/emuconsole.c index 79df39a..c068095 100644 --- a/src/emuconsole.c +++ b/src/emuconsole.c @@ -64,7 +64,7 @@ console_exec(char *Address, char *NumberInst) { int NbInst = -1; /* -1 is infinity */ if (strlen(Address) == 0) { - printf("Invalid address\n"); + log_err("Invalid address"); return; } @@ -76,7 +76,7 @@ console_exec(char *Address, char *NumberInst) InitUnixKB(); - printf("Program executing...\n"); + log_info("Program executing..."); do { cpu8051_Exec(); @@ -85,12 +85,12 @@ console_exec(char *Address, char *NumberInst) } while (!IsBreakpoint(cpu8051.pc) && (NbInst != 0) && !kbhit()); if (kbhit()) { (void) getch(); /* Flush key */ - printf("Caught break signal!\n"); + log_info("Caught break signal!"); } if (NbInst == 0) - printf("Number of instructions reached! Stopping!\n"); + log_info("Number of instructions reached! Stopping!"); if (IsBreakpoint(cpu8051.pc)) - printf("Breakpoint hit at %.4X! Stopping!\n", cpu8051.pc); + log_info("Breakpoint hit at %.4X! Stopping!", cpu8051.pc); ResetUnixKB(); } @@ -188,9 +188,9 @@ console_show_registers(void) static void console_reset(void) { - printf("Resetting... "); + log_info("Resetting..."); cpu8051_Reset(); - printf("Done.\n"); + log_info("Done"); console_show_registers(); }