Michael, I think we can do better than "tail" command. The design for printing log messages is prepared to print on all registered consoles. We have restricted the console_logger() function to just output on the async console out of concernt that sending output to the remote consoles might be too much of a burden. But if that is what's desired for a particular user's scenario, then what we should do is to add a command to direct the output to all consoles. -- Steve On Wed, 10 Jan 2018, Michael Balzer wrote:
Mark,
I've built a simple "tail" command to follow the file log on the telnet console.
Unfortunately -- with v2.1 -- the fflush() on the log file doesn't work as expected, the file contents will not be updated until I close the file.
Is that issue solved with v3.x?
Regards, Michael
Am 08.01.2018 um 07:28 schrieb Mark Webb-Johnson:
I've restructured the log commands a bit:
* The old "level <severity>" command has moved to "log level <severity>"
* A new "log file <path>" command has been added. For example "log file /sd/log.txt" will mean that anything that gets logged to the console will also get appended to /sd/log.txt as well, until reboot. You can use /sd (if SD CARD is working for you), or /store (but take care - that is system flash).
* You should be able to hook this in at the "sd.mounted" event script, to turn on logging to sd card on boot (again, if SD CARD is working for you).
Enjoy, Mark
Branch: refs/heads/master Home: https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3 Commit: 6947670e33823dd68d4bf76b7872518fc8398264 https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/6947... Author: Mark Webb-Johnson <mark@webb-johnson.net <mailto:mark@webb-johnson.net>> Date: 2018-01-08 (Mon, 08 Jan 2018)
Changed paths: M vehicle/OVMS.V3/main/console_async.cpp M vehicle/OVMS.V3/main/ovms_command.cpp M vehicle/OVMS.V3/main/ovms_log.h M vehicle/OVMS.V3/main/ovms_main.cpp
Log Message: ----------- Add support for "log file ..." to log to the specified vfs file
_______________________________________________ OvmsDev mailing list OvmsDev@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