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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: net/cronet/android/android_log.h
diff --git a/net/cronet/android/android_log.h b/net/cronet/android/android_log.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff05823b73dad8fb5a115cd7cb4cb00668de8a9e
--- /dev/null
+++ b/net/cronet/android/android_log.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_CRONET_ANDROID_ANDROID_LOG_H_
+#define NET_CRONET_ANDROID_ANDROID_LOG_H_
+
+#include <android/log.h>
+
+// Specifies the granularity of events that should be logged.
+enum LoggingLevel {
+ // Don't log anything
+ LOG_NONE = 0,
+
+ // Log major events useful for debugging
+ LOG_DEBUG,
+
+ // Log everything
+ LOG_VERBOSE,
+};
+
+#define LOGD(tag, log_level, ...) \
+ if ((log_level) == LOG_DEBUG || (log_level) == LOG_VERBOSE) \
+ __android_log_print(ANDROID_LOG_DEBUG, (tag), __VA_ARGS__)
+
+#define LOGV(tag, log_level, ...) \
+ if ((log_level) == LOG_VERBOSE) \
+ __android_log_print(ANDROID_LOG_VERBOSE, (tag), __VA_ARGS__)
+
+#define LOGE(tag, ...) \
+ __android_log_print(ANDROID_LOG_ERROR, (tag), __VA_ARGS__)
+
+#define ASSERT(tag, condition) \
+ if (!(condition)) \
+ __android_log_assert(#condition, tag, "Assert failed: " #condition)
+
+#endif // NET_CRONET_ANDROID_ANDROID_LOG_H_

Powered by Google App Engine
This is Rietveld 408576698