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

Side by Side Diff: net/cronet/android/android_log.h

Issue 145213003: Initial upload of cronet for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added cronet_package target to copy cronet.jar and stripped libcronet.so Created 6 years, 10 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 #ifndef NET_CRONET_ANDROID_ANDROID_LOG_H_
6 #define NET_CRONET_ANDROID_ANDROID_LOG_H_
7
8 #include <android/log.h>
9
10 // Specifies the granularity of events that should be logged.
11 enum LoggingLevel {
12 // Don't log anything
13 LOG_NONE = 0,
14
15 // Log major events useful for debugging
16 LOG_DEBUG,
17
18 // Log everything
19 LOG_VERBOSE,
20 };
21
22 #define LOGD(tag, log_level, ...) \
23 if ((log_level) == LOG_DEBUG || (log_level) == LOG_VERBOSE) \
24 __android_log_print(ANDROID_LOG_DEBUG, (tag), __VA_ARGS__)
25
26 #define LOGV(tag, log_level, ...) \
27 if ((log_level) == LOG_VERBOSE) \
28 __android_log_print(ANDROID_LOG_VERBOSE, (tag), __VA_ARGS__)
29
30 #define LOGE(tag, ...) \
31 __android_log_print(ANDROID_LOG_ERROR, (tag), __VA_ARGS__)
32
33 #define ASSERT(tag, condition) \
34 if (!(condition)) \
35 __android_log_assert(#condition, tag, "Assert failed: " #condition)
36
37 #endif // NET_CRONET_ANDROID_ANDROID_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698