From: ian Date: Wed, 23 Apr 2008 20:05:35 +0000 (+0000) Subject: remove logmsg and vlogmsg X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=3ff696d5b23a03671a80e736548d32e177f8bdcf;p=trains.git remove logmsg and vlogmsg --- diff --git a/hostside/README.commands b/hostside/README.commands index 5cbfd54..adf687e 100644 --- a/hostside/README.commands +++ b/hostside/README.commands @@ -43,7 +43,11 @@ POSSIBLY-ASYNCHRONOUS REPORTING OF MESSAGES TO/FROM (MASTER) PIC U< warning watchdog : PIC watchdog timer triggered U< warning spurious : spurious short circuit (fault) etc. + U< signalling-problem .... + U< signalling-problem detection : + U< debug : + U< info : ====================================================================== diff --git a/hostside/persist.c b/hostside/persist.c index d10a3ea..e28553d 100644 --- a/hostside/persist.c +++ b/hostside/persist.c @@ -144,7 +144,7 @@ static int persist_convert(const char *data, const char *conv) { static int try(const char *data, const char *conv) { if (!persist_convert(data,conv)) return 0; - logmsg(0,0,0, "converted %s using %s",data,conv); + oprintf(UPO, "info : converted %s using %s",data,conv); return 1; } diff --git a/hostside/realtime.c b/hostside/realtime.c index b2e3673..72e7c8e 100644 --- a/hostside/realtime.c +++ b/hostside/realtime.c @@ -64,25 +64,6 @@ static char *transegn2suffixstring(Train *tra, Segment *seg) { return s; } -void vlogmsg(const char *intro, Train *tra, const SegmentInfo *segi, - const char *fmt, va_list al) { - oprintf(UPO, "log %s", intro); - if (segi) oprintf(UPO, " @%s", segi->pname); - if (tra) oprintf(UPO, " %s", tra->pname); - if (segi || tra) oprintf(UPO, ":"); - oprintf(UPO," "); - ovprintf(UPO,fmt,al); - oprintf(UPO, "\n"); -} - -void logmsg(const char *intro, Train *tra, const SegmentInfo *segi, - const char *fmt,...) { - va_list al; - va_start(al,fmt); - vlogmsg(intro,tra,segi,fmt,al); - va_end(al); -} - void safety_vpanic(Train *tra, Segment *seg,const char *fmt,va_list al) { char *msg, *where; PicInsn piob; diff --git a/hostside/safety.c b/hostside/safety.c index 0501bef..d14bd55 100644 --- a/hostside/safety.c +++ b/hostside/safety.c @@ -647,8 +647,8 @@ ErrorCode predict_confirm(Train *tra, int accelerate, static void detection_report_problem(Train *tra, Segment *seg, void *pu, const char *message) { - logmsg("SignallingProblemPredicted",tra,seg->i, - "re detection @%s: %s", tra->foredetect->i->pname, message); + oprintf(UPO, "signalling-problem %s @%s detection @%s : %s", + tra->pname, tra->foredetect->i->pname, seg->i->pname, message); } void safety_notify_detection(Segment *seg) { diff --git a/hostside/safety.h b/hostside/safety.h index 4a1ff6c..8072dfd 100644 --- a/hostside/safety.h +++ b/hostside/safety.h @@ -82,11 +82,6 @@ struct Segment { * handling, arg parsing, etc. */ -void vlogmsg(const char *intro, Train *tra, const SegmentInfo *segi, - const char *fmt, va_list al) __attribute__((format(printf,4,0))); -void logmsg(const char *intro, Train *tra, const SegmentInfo *segi, - const char *fmt, ...) __attribute__((format(printf,4,5))); - void safety_vpanic(Train *tra, Segment *seg, const char *fmt, va_list al) __attribute__((format(printf,3,0),noreturn)); void safety_panic(Train *tra, Segment *seg, const char *fmt,...)