I'd like to log to a file appending new lines and when a maximum size is reached removing older lines in favor of new ones such that the log file does not occupy too much memory.
I know this is possibile in python (https://stackoverflow.com/questions/245 ... -in-python).
I'd like to do the same in MicroPython to understand why my script crashes unpredictably.
I've looked at logging in micrpython-lib but I didn't found this feature (https://github.com/micropython/micropyt ... er/logging).
Any help is approciated.
Thank you
logging to a log file with limited size
-
- Posts: 28
- Joined: Mon Aug 27, 2018 4:43 pm
Re: logging to a log file with limited size
This fork has the RotatingFileHandler: https://github.com/pfalcon/pycopy-lib/b ... andlers.py
-
- Posts: 28
- Joined: Mon Aug 27, 2018 4:43 pm
Re: logging to a log file with limited size
Thank you: I'll try it