losing my logs every time as the Rpi loses power mid-inference

running a model locally on a Rpi, no internet on it. was just appending logs to a plain text file and a power loss mid-write corrupted it is half unreadable now.

what's a reliable way to write logs that survives something like this?

reddit.com
u/norashut — 1 day ago
▲ 2 r/Python

ever had a log file get corrupted from a crash mid-write?

happened to me recently, lost half a log file to a power cut. made me realize i've never actually thought about crash-safety in anything i write to disk.

how do you all handle this in your own stuff, if at all?

reddit.com
u/norashut — 1 day ago

losing my logs every time the pi loses power mid-inference

running a model locally on a pi, no internet on it. was just appending logs to a plain text file and a power loss mid-write corrupted it is half unreadable now.

what's a reliable way to write logs that survives something like this?

reddit.com
u/norashut — 1 day ago