Skip to content
Commit cd281ab4 authored by Kamil Krzyzanowski's avatar Kamil Krzyzanowski Committed by Benjamin Cabé
Browse files

logging: fs backend: simplify checking if file exists



In order to check if the desired log file exists, the backend would open
the directory, then go through all the files seeing if one of them matches
the correct filename. Simplify to just `fs_stat` the file instead.

This has the added side effect of lowering the time spent checking if the
file exists after every log. Some quick testing revealed the time spent
checking went down from ~150-300ms to ~10ms (on my specific board, with a
nRF9160 writing to a LittleFS on external flash).

Signed-off-by: default avatarKamil Krzyzanowski <kamnxt@kamnxt.com>
parent 8348d9a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment