When using GNU Screen as a serial port terminal, is there a way to show a timestamp on each line as it is sent/received?
-
screen can add a timestamp to a logfile when the tty is idle, and again when active. are you not running any application that does i/o to the port? what is writing to the port, for example?– meuhSep 24, 2015 at 15:02
-
Yes, there is I/O to the port. A custom program is writing to the serial port, but in this case I was unable to modify the code received on the serial port to include a timestamp, so I'm wanting to add the timestamp using GNU Screen.– Matthew RankinSep 27, 2015 at 1:22
2 Answers
I added the following lines to the configuration file:
logtstamp after 5
logtstamp on
Then I started Screen using:
$ screen -L -c muxscreenrc /dev/tty.usbserial-A5027V8X 115200
The timestamp doesn't appear in the Screen session, but the saved log file did include timestamps.
This isn't exactly what I want, but it's close enough for my use case.
Install or download the "multitail" program. Set GNU screen to log to a disk file.
Tail the screen log file with multitail, as it reads the screen log file it adds timestamps to individual lines in its own window.