Closed Jaymon closed 4 years ago
I need a testdata.stream("/path/to/logfile")
and it will tail that file and just print everything to stdout that gets put into the file.
You could solve this using Command:
c = Command("tail -n 0 -f /path/to/file")
c.run_async()
Something I didn't think of: permissions
the ideal way to do this for any higher level log files is probably something like:
Command("sudo tail -n 0 -f /var/log/syslog", logger_prefix="").run_async()
the idea being that you would start the service, but then give it a file path and it would tail that file in another thread and dump its contents to the screen, or at least allow access to the content.
This comes up because we start something, but it is a service that writes to a logfile, so if you want to see why the request to the service failed, you have to open another shell and go tail its log file, which is annoying.