mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Is it possible to consider adding log callBack on Android?

Open lilinxiong opened this issue 1 year ago • 2 comments

Please make sure that this is a feature request.

System information (Please provide as much relevant information as possible)

  • MediaPipe Solution (you are using): framework
  • Programming language : C++ / Android Java
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state:
We have used mediapipe in the production environment, it is really great, but there will be some crashes in the production environment, because it is a production environment, so there is no symbol table of the native layer, because the crash is in C++, there are no some log, it is difficult to determine the call stack information. and context

Will this change the current api? How? Will change because the log callback interface needs to be added to the JNI layer. But it only changes the JNI layer.

Who will benefit with this feature? All developers using mediapipe on the Android platform

Please specify the use cases for this feature:

    AndroidLog.nativeInjectLoggable(new JNILogging((message, severity, tag) -> {
      if (severity == Loggable.Severity.LS_DEBUG) {
          // do something eg: Use other log libraries in the current application save debug level log
      } else if (severity == Loggable.Severity.LS_INFO) {
          // do something eg:  Use other log libraries in the current application save info level log
      } else if (severity == Loggable.Severity.LS_WARNING) {
         // do something eg:  Use other log libraries in the current application save warning level log
      } else if (severity == Loggable.Severity.LS_ERROR) {
         // do something eg:  Use other log libraries in the current application save error level log
      }
    }));

Any Other info:

lilinxiong avatar Sep 10 '22 04:09 lilinxiong

Hi @lilinxiong, Thanks for raising this feature request. We will share this request with the internal team and will update if any specific update on the above request. Thank you!

kuaashish avatar Sep 12 '22 09:09 kuaashish

@kuaashish Thanks for your reply, In fact, the day before yesterday, I had simply implemented it myself, but the writing was really ugly. It was just enough to satisfy my own use. Tomorrow I plan to tidy it up and rewrite it beautifully. But I'm still looking forward to your conclusions.

lilinxiong avatar Sep 12 '22 09:09 lilinxiong