picamera2 icon indicating copy to clipboard operation
picamera2 copied to clipboard

disable logging when taking picture

Open LeifSec opened this issue 7 months ago • 5 comments

Following issue I want to switch off logging / set logging level to ERROR for calling a function

camera.switch_mode_and_capture_image(
                camera_config=self.__settings.still_configuration,
                name="main",
                wait=None,
                signal_function=None)

. So I did:

if "picamera2" not in logging.Logger.manager.loggerDict.keys():
            raise ValueError("not in tt")
logger = logging.getLogger("picamera2")
logger.setLevel(logging.ERROR)
camera.switch_mode_and_capture_image(....
logger.setLevel(old_level)

Unfortunately there is still this INFO level logging:

163:48:59.073898409] [27530]  INFO Camera camera.cpp:1183 configuring streams: (0) 1536x864-BGR888 (1) 4608x2592-SBGGR10_CSI2P
[163:48:59.097958056] [27500]  INFO RPI vc4.cpp:621 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 4608x2592-SBGGR10_1X10 - Selected unicam format: 4608x2592-pBAA
[163:48:59.516137626] [27530]  INFO Camera camera.cpp:1183 configuring streams: (0) 1536x864-XBGR8888 (1) 2304x1296-SBGGR10_CSI2P
[163:48:59.525447463] [27500]  INFO RPI vc4.cpp:621 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA

I am using imx708 camera and latest Raspberian 12 software.

LeifSec avatar Jul 22 '24 11:07 LeifSec