awslabs / amazon-kinesis-video-streams-producer-sdk-cpp

Amazon Kinesis Video Streams Producer SDK for C++ is for developers to install and customize for their connected camera and other devices to securely stream video, audio, and time-encoded data to Kinesis Video Streams.
Apache License 2.0
373 stars 334 forks source link

[FEATURE] Make log level in kvssink configurable. #1180

Closed mateuszboryn closed 3 months ago

mateuszboryn commented 3 months ago

Is your feature request related to a problem? Please describe. Currently, kvssink GST component has hardcoded loglevel to DEBUG. https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blame/master/src/gstreamer/gstkvssink.cpp#L761

It is annoying to see multiple DEBUG messages in long-running GST pipeline.

Describe the solution you'd like Kindly please make log4cpp logging appender push to gstreamer logging. This way, kvssink would have gstreamer compatible logging.

Describe alternatives you've considered

  1. Hardcode higher level of logging instead of DEBUG (INFO, WARN?) - quick fix, but hiding any potential issues permanently.
  2. Set log level there, with if(GST_LOG_LEVEL==GST_DEBUG) { LOG_CONFIGURE_STDOUT("DEBUG");} else if(GST_LOG_LEVEL==GST_INFO) {LOG_CONFIGURE_STDOUT("INFO");} statement during initialization - better one, but logging output is still fully controlled by log4cpp appender.
  3. Rely on log4cpp config (for GST pipelines it would be yet another place to configure logging, which is inconvenient for gstreamer users)

Additional context none

disa6302 commented 3 months ago

@mateuszboryn ,

The log level should be configurable. The SDK uses the kvs_log_configuration file to set the log level. (https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/v3.4.1/src/gstreamer/gstkvssink.cpp#L1583-L1590). This is where you set the log level if using the SDK provided log file: https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/v3.4.1/kvs_log_configuration#L1

You could also provide your own log config file by using the log-config property.

Am I missing something here or does this not work for you?