I am using a logger in my Python 2.7 code to create a CSV to plot. It is running on an embedded module without an RTC. I don't have any use for a timestamp, but would like to include a label, so I can plot them easier. The logger is set up in such a way that it continues between reboots.
I am currently logging with a formatter providing a label like this:
# Add formatter to the file handler.
formatter = logging.Formatter('%(asctime)s,%(message)s','%H:%M:%S')
fh.setFormatter(formatter)
but as the board does not have an RTC would like to just log the line number as a label instead of the time.
How to go about this? I can not just have an incremental integer as the next time the program starts it will start from scratch instead of increment.
Thanks in advance!