1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_logging.h"
7 #include <gestures/gestures.h>
10 #include "base/logging.h"
11 #include "base/strings/stringprintf.h"
15 std::string
FormatLog(const char* fmt
, va_list args
) {
16 std::string msg
= base::StringPrintV(fmt
, args
);
17 if (!msg
.empty() && msg
[msg
.size() - 1] == '\n')
18 msg
.erase(msg
.end() - 1, msg
.end());
24 void gestures_log(int verb
, const char* fmt
, ...) {
27 if (verb
<= GESTURES_LOG_ERROR
)
28 LOG(ERROR
) << "gestures: " << FormatLog(fmt
, args
);
29 else if (verb
<= GESTURES_LOG_INFO
)
30 VLOG(3) << "gestures: " << FormatLog(fmt
, args
);