I am using notecard_pi.py and started noticing a large number of log messages:
Lock 3056999600 acquired on serial.lock
Lock 3056999600 released on serial.lock
Lock 3056999600 acquired on serial.lock
Lock 3056999600 released on serial.lock
Lock 3056999600 acquired on serial.lock
Lock 3056999600 released on serial.lock
every time code invokes a notecard function.
Search through all my code, no luck. For the life of me, where are those strings coming from?!
Hey @Francois that’s odd. I just double-checked to make sure we didn’t let a stray print
sneak into the latest release, but it doesn’t look like it, so this must be a debug statement from the filelock
library. Let me poke around and see if that’s the case and if we can disable it.
@Francois confirmed, it’s the filelock library, which we use to prevent multiple conflicting Notecard operations over serial on the Raspberry Pi. py-filelock/filelock.py at b30bdc4fb998f5f4350257235eb51147f9e81862 · benediktschmitt/py-filelock · GitHub. It doesn’t look like the library provides an easy way to opt out of this logging (which is unfortunate). If this is a nuisance to you, I can log an issue with them, push a fix or potentially find an alternative library for us to include.
Thanks. Looks like switching to I2C does create the log entries. Checking overnight.
@Francois did you mean to say it does not? Please let me know what you find because that would definitely be a regression if filelock is logging on I2C operations. It should be a serial-only dependency.
Overnight result: there is no logging on I2C. Only on Serial.
Great, thanks for following up @Francois
Makes my i2c decision look prescient!