summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkristianm <kristianm@google.com>2010-01-14 17:14:07 -0800
committerkristianm <kristianm@google.com>2010-01-14 18:25:18 -0800
commit2e2725239c3761147d88e0322427cc63b70c7b96 (patch)
treebf3f8692e1b8a373fd5026b1dcdc04d860b8d644
parent9b78e1d1e0bd819ae03df5594d4a56519e5d87c7 (diff)
downloadpackages_apps_Browser-2e2725239c3761147d88e0322427cc63b70c7b96.zip
packages_apps_Browser-2e2725239c3761147d88e0322427cc63b70c7b96.tar.gz
packages_apps_Browser-2e2725239c3761147d88e0322427cc63b70c7b96.tar.bz2
Added framework for logging
Startet on logging from the browser. This commit is just the tools for logging, nothing is being logged yet.
-rw-r--r--Android.mk4
-rw-r--r--src/com/android/browser/EventLogTags.logtags14
-rw-r--r--src/com/android/browser/LogTag.java53
3 files changed, 70 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 0e7279c..92fcb1c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -5,7 +5,9 @@ LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := google-framework
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
+LOCAL_SRC_FILES := \
+ $(call all-subdir-java-files) \
+ src/com/android/browser/EventLogTags.logtags
LOCAL_PACKAGE_NAME := Browser
diff --git a/src/com/android/browser/EventLogTags.logtags b/src/com/android/browser/EventLogTags.logtags
new file mode 100644
index 0000000..c9bb5b0
--- /dev/null
+++ b/src/com/android/browser/EventLogTags.logtags
@@ -0,0 +1,14 @@
+# See system/core/logcat/event.logtags for a description of the format of this file.
+
+option java_package com.android.browser
+
+# This event is logged when a user adds a new bookmark. This could just be a boolean,
+# but if lots of users add the same bookmark it could be a default bookmark on the browser
+70103 browser_bookmark_added (url|3)
+
+# This event is logged after a page has finished loading. It is sending back the page url,
+# and how long it took to load the page. Could maybe also tell the kind of connection (2g, 3g, WiFi)?
+70104 browser_page_loaded (url|3), (time|2|3)
+
+# This event is logged when the user navigates to a new page, sending the time spent on the current page
+70105 browser_timeonpage (url|3), (time|2|3)
diff --git a/src/com/android/browser/LogTag.java b/src/com/android/browser/LogTag.java
new file mode 100644
index 0000000..9658c6c
--- /dev/null
+++ b/src/com/android/browser/LogTag.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.browser;
+
+import android.util.Log;
+import android.util.EventLog;
+
+public class LogTag {
+
+ /**
+ * Log when the user is adding a new bookmark.
+ *
+ * @param url the url of the new bookmark.
+ */
+ public static void logBookmarkAdded(String url) {
+ EventLog.writeEvent(EventLogTags.BROWSER_BOOKMARK_ADDED, url);
+ }
+
+ /**
+ * Log when a page has finished loading with how much
+ * time the browser used to load the page.
+ *
+ * @param url the heartbeat interval used.
+ * @param duration the time the browser spent loading the page.
+ */
+ public static void logPageFinishedLoading(String url, long duration) {
+ EventLog.writeEvent(EventLogTags.BROWSER_BOOKMARK_ADDED, url);
+ }
+
+ /**
+ * log the time the user has spent on a webpage
+ *
+ * @param url the url of the page that is being logged (old page).
+ * @param duration the time spent on the webpage.
+ */
+ public static void logTimeOnPage(String url, long duration) {
+ EventLog.writeEvent(EventLogTags.BROWSER_BOOKMARK_ADDED, url);
+ }
+}