Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1378)

Side by Side Diff: ui/events/ozone/evdev/libgestures_glue/gesture_logging.cc

Issue 193813003: ozone: evdev: Add libgestures bindings for touchpad & mouse support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved 1 space by 1 character Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_logging.h"
6
7 #include <gestures/gestures.h>
8 #include <stdarg.h>
9
10 #include "base/logging.h"
11 #include "base/strings/stringprintf.h"
12
13 namespace {
14
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());
19 return msg;
20 }
21
22 } // namespace
23
24 void gestures_log(int verb, const char* fmt, ...) {
25 va_list args;
26 va_start(args, 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);
31 va_end(args);
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698