1
0
mirror of https://github.com/simh/simh.git synced 2026-05-01 22:06:00 +00:00

SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)

The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
This commit is contained in:
Mark Pizzolato
2014-03-28 08:20:05 -07:00
parent e81de979f6
commit 6ce8d99cd8
46 changed files with 332 additions and 498 deletions

View File

@@ -1514,7 +1514,7 @@ controller->control_out_operations_completed = 0;
controller->ddcmp_control_packets_received = 0;
controller->ddcmp_control_packets_sent = 0;
printf("Statistics reset\n" );
sim_printf("Statistics reset\n");
return SCPE_OK;
}
@@ -2569,6 +2569,15 @@ if (!buffer) {
dmc_showddcmp (sim_log, controller->unit, 0, NULL);
fflush (sim_log);
}
if (sim_deb) {
fprintf (sim_deb, "DDCMP Buffer allocation failure.\n");
fprintf (sim_deb, "This is a fatal error which should never happen.\n");
fprintf (sim_deb, "Please submit this output when you report this bug.\n");
dmc_showqueues (sim_deb, controller->unit, 0, NULL);
dmc_showstats (sim_deb, controller->unit, 0, NULL);
dmc_showddcmp (sim_deb, controller->unit, 0, NULL);
fflush (sim_deb);
}
return buffer;
}
buffer->address = 0;
@@ -3741,9 +3750,7 @@ if (!cptr || !*cptr)
if (!(uptr->flags & UNIT_ATTABLE))
return SCPE_NOATT;
if (!peer[0]) {
printf ("Peer must be specified before attach\n");
if (sim_log)
fprintf (sim_log, "Peer must be specified before attach\n");
sim_printf ("Peer must be specified before attach\n");
return SCPE_ARG;
}
sprintf (attach_string, "Line=%d,Connect=%s,%s", dmc, peer, cptr);