extern void logging_init (void);
extern FILE *log_open (const TCHAR *name, int append, int bootlog, TCHAR*);
extern void log_close (FILE *f);
+extern TCHAR *write_log_get_ts(void);
extern bool use_long_double;
int serdev;
int seriallog = 0, log_sercon = 0;
int serial_enet;
+static bool seriallog_lf;
extern int consoleopen;
void serial_open (void);
#endif
if (log_sercon) {
serial_period_hsyncs = 1;
- seriallog = 1;
+ seriallog = log_sercon;
+ seriallog_lf = true;
write_logx(_T("\n"));
}
if (seriallog > 0 || (consoleopen && seriallog < 0)) {
gotlogwrite = true;
- write_logx(_T("%c"), docharlog(serdatshift_masked));
+ if (seriallog_lf && seriallog > 1) {
+ TCHAR *ts = write_log_get_ts();
+ if (ts)
+ write_logx(_T("%s:"), ts);
+ seriallog_lf = false;
+ }
+ TCHAR ch = docharlog(serdatshift_masked);
+ write_logx(_T("%c"), ch);
+ if (ch == 10)
+ seriallog_lf = true;
}
if (serper == 372) {
log_sercon = 1;
return 1;
}
+ if (!_tcscmp(arg, _T("serlog2"))) {
+ log_sercon = 2;
+ return 1;
+ }
if (!_tcscmp(arg, _T("a2065log"))) {
log_a2065 = 1;
return 1;
static int lfdetected = 1;
-static TCHAR *writets (void)
+TCHAR *write_log_get_ts(void)
{
struct tm *t;
struct _timeb tb;
bufp[bufsize - 1] = 0;
if (!_tcsncmp (bufp, _T("write "), 6))
bufsize--;
- ts = writets ();
+ ts = write_log_get_ts();
if (bufp[0] == '*')
count++;
if (SHOW_CONSOLE || console_logging) {