Cleanups to make all logging functions use stdlog instead of stdout.

The new --logfile (-L) commandline option sets a file to log to.
The new --debug (-D) forces output to stderr if no logfile is given.
This commit is contained in:
waltje
2017-11-24 02:23:00 -05:00
parent d287293a75
commit ce1bab2967
20 changed files with 1547 additions and 1571 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)cdrom.c 1.0.22 2017/11/04
* Version: @(#)cdrom.c 1.0.23 2017/11/24
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -721,20 +721,23 @@ uint8_t cdrom_mode_sense_pages_saved[CDROM_NUM][0x40][0x40] =
int cdrom_do_log = ENABLE_CDROM_LOG;
#endif
void cdrom_log(const char *format, ...)
static void
cdrom_log(const char *format, ...)
{
#ifdef ENABLE_CDROM_LOG
if (cdrom_do_log)
{
va_list ap;
va_start(ap, format);
vprintf(format, ap);
vfprintf(stdlog, format, ap);
va_end(ap);
fflush(stdout);
fflush(stdlog);
}
#endif
}
int cdrom_mode_select_terminate(uint8_t id, int force);
int find_cdrom_for_channel(uint8_t channel)