To santa claus...

29 views
Skip to first unread message

Bernard Mayer

unread,
May 3, 2020, 9:51:10 AM5/3/20
to kplex
Dear Santa
As I have been very wise, I would like a new feature in kplex.
Could you, please, make the filename in which kplex writes its logs be suffixed by a time stamp ?
like NameOfFile_20200428123456.log by directive filename=NameOfFile_${yyyymmddhhiiss} ?
and more precision in the file for optionnal timestamp ? like $IIxxx -> <nbOfSeconds><separator like TAB><NMEA sentence>

Bernard Mayer

unread,
May 3, 2020, 12:02:36 PM5/3/20
to kplex
ok for internal timestamp :
[file]
.../...
timestamp=ms (or s or ?)

and file produced contains
\c:1588516205*58\<nmea sentence>
the number are "epoch", the number of seconds since 1970 january first

Keith Young

unread,
May 9, 2020, 8:39:02 AM5/9/20
to kplex

Could you, please, make the filename in which kplex writes its logs be suffixed by a time stamp ?
like NameOfFile_20200428123456.log by directive filename=NameOfFile_${yyyymmddhhiiss} ?
and more precision in the file for optionnal timestamp ? like $IIxxx -> <nbOfSeconds><separator like TAB><NMEA sentence>

You are not the first to request filenames with a date extension.  Previously I've suggested that people should log to a file and use logrotate(8) to add extensions for archival purposes (i.e. same as is done for messages and other /var/log/* files on many linux systems.  I don't want to break backwards compatibility (ie if someone somewhere has "filename=$(mmdd)" and they actually *want* the file called "$(mmdd)" for some bizarre reason, I don't want it to suddenly change to "0509", but I can add a new option (e.g. "filenamex") if people really really need it.

Can you clarify what you mean by the "more precision" statement?  Was that what you answered yourself below?  NMEA-0183v4 timestamps can be either second precision or millisecond: kples switches with timestamp=ms or timestamp=s which of course you know, so I may be misunderstanding this (sorry).

Bernard Mayer

unread,
May 12, 2020, 10:46:48 AM5/12/20
to kplex
Yes, you are right.
1 tool for 1 function, 

I will use the init process to modify the name of the target file in kplex.conf before launching, (and maybe save it if it already exists.)
Thanks Santa ! ;-)

Keith Young

unread,
Jul 17, 2020, 6:49:49 PM7/17/20
to kplex
I have implemented a new option for file interfaces "filenamex" ("extened filename") which will allow you substitute dates/times in the strftime(3) format.  This also has provision for other substitutions but so far all that is implemented is ability to substitute the local machine's hostname ("%{host}").  The new option is in the "filenamex" branch on github but it's had almost no testing and I've had far too much wine before pushing a commit.  Have a look and see if this might suit your need.
Reply all
Reply to author
Forward
0 new messages