Open LeifSec opened 4 months ago
Yes, this is all libcamera logging and it can be quite chatty. It might be easiest just to put something like export LIBCAMERA_LOG_LEVELS=*:3
in your .bashrc
...
export LIBCAMERA_LOG_LEVELS=*:3
works - thank you very much. But as I need it in the code (to disable it just for that call of switch_mode_and_capture_image
) I need something like:
os.environ["LIBCAMERA_LOG_LEVELS"] = "*:3"
camera.switch_mode_and_capture_image(...`
os.environ["LIBCAMERA_LOG_LEVELS"] = "*:old_level"
But this does not work.
Yes, libcamera probably only reads that environment variable when it starts up. So far as I know, there's no Python interface to libcamera's logging system after that. So I don't really have a workaround for you there. Can you say which of the logging messages are actually useful? I'm wondering whether you can turning them all off, and add your own logging for your application.
Maybe also INFO Camera camera.cpp:1183 configuring streams: ( ...
is usefull in some cases.
But I am taking pictures for two reasons
For both I want to get error messages. For the main application maybe also info messages are usefull. But for the live stream they info messages are spamming my log.
Unfortunately, so far as I know, there's no way to adjust the logging at runtime. But note that by choosing the logging level appropriately, you can still get warnings and errors. When it comes to configuring streams, you can easily print out the details of the configuration you got, for the purpose of double-checking what's going on.
Following issue I want to switch off logging / set logging level to ERROR for calling a function
. So I did:
Unfortunately there is still this INFO level logging:
I am using
imx708
camera and latest Raspberian 12 software.