[Ovmsdev] CAN-3 broken again?

Stephen Casner casner at acm.org
Fri Jan 12 08:01:57 HKT 2018


Michael,

I've implemented the multi-console logging (on the "for-master"
branch).  I kept your CR/LF replacement, but added another loop to
remove any vertical bars at the end of the aggregated line.  I also
changed the writing to the log file to be after the CR/LF replacement
rather than before.

                                                        -- Steve

On Thu, 11 Jan 2018, Michael Balzer wrote:

> Steve,
>
> LFs will be injected into the log if a notification or command result is sent:
>
> I (544365) ovms-server-v2: Send MP-0 PITopping off|CHG: 0 (~0) Wh|Full: 124 min.|Range: 50 - 48Km|SOC: 70.0% (70.0..70.0%)|ODO: 47026.7Km|CAP: 89.7% 96.9Ah|SOH:
> 100%|
> D (550265) ovms-server-v2: TransmitNotifyData: msg=RT-BAT-P,1,86400,1,1,6998,6998,6998,574,574,574,29,29,29,5,1,190,20|
>
> These were the reason for my change. Will probably also occur if a user command received contains CR/LF.
>
> At the moment, the simcom module also injects CR/LF on tx logs:
>
> D (28345) simcom: tx scmd ch=0 len=4   : AT||
> D (44345) simcom: tx scmd ch=0 len=103 : AT+CPIN?;+CREG=1;+CTZU=1;+CTZR=1;+CLIP=1;+CMGF=1;+CNMI=1,2,0,0,0;+CSDH=1;+CMEE=2;+CSQ;+AUTOCSQ=1,1;E0||
>
> Don't know if that covers all cases.
>
> Basically this also applies everywhere a string of external / user supplied source gets logged (little Bobby Tables). I can for example imagine a broken Wifi
> network sending an SSID containing CR/LF.
>
> Regards,
> Michael
>
>
> Am 11.01.2018 um 19:07 schrieb Stephen Casner:
> > On Thu, 11 Jan 2018, Michael Balzer wrote:
> >
> >>   * Line 294: this should be a warning level log, also the "\n" at
> >>     the end isn't necessary for a log.
> > This should be stated more strongly: Not only is it not necessary, it should just
> > not be there.  It is also not optional, it won't be ignored.  It used
> > to cause a blank line in the output, but now it causes a '|' character
> > to be appended after after a change that Michael made a while back.
> >
> > Michael, when I first saw that change you made to translate all \n or \r
> > except the last to be '|', thereby unfolding a multi-line log into one
> > line, I did not really like that idea but I didn't comment at the
> > time.  It seems to me that if the format of a multi-line log message
> > causes a problem then it would be best to go back to the original log
> > message and change it.  Perhaps you were bothered by some log message
> > in code that is not under our control?  Can you show some examples?
> >
> > I bring this up now because that bit of code needs to move as I
> > implement the facility to log on all consoles, and I would like to
> > consider removing it.
> >
> >                                                         -- Steve
> > _______________________________________________
> > OvmsDev mailing list
> > OvmsDev at lists.teslaclub.hk
> > http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>
> --
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
>
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>
>



More information about the OvmsDev mailing list