Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc2deb96 authored by Harry Cutts's avatar Harry Cutts Committed by Android (Google) Code Review
Browse files

Merge "touchpad: hide non-error Gestures library logs" into main

parents d1c0685f 6acb3ed0
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -26,16 +26,31 @@

extern "C" {

namespace {

/**
 * Log details of each gesture output by the gestures library.
 * Enable this via "adb shell setprop log.tag.TouchpadInputMapperGestures DEBUG" (requires
 * restarting the shell)
 */
const bool DEBUG_TOUCHPAD_GESTURES =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, "TouchpadInputMapperGestures",
                                  ANDROID_LOG_INFO);

} // namespace

void gestures_log(int verb, const char* fmt, ...) {
    va_list args;
    va_start(args, fmt);
    if (verb == GESTURES_LOG_ERROR) {
        LOG_PRI_VA(ANDROID_LOG_ERROR, LOG_TAG, fmt, args);
    } else if (verb == GESTURES_LOG_INFO) {
    } else if (DEBUG_TOUCHPAD_GESTURES) {
        if (verb == GESTURES_LOG_INFO) {
            LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, fmt, args);
        } else {
            LOG_PRI_VA(ANDROID_LOG_DEBUG, LOG_TAG, fmt, args);
        }
    }
    va_end(args);
}
}