[tracker/thunderbird-24: 1/4] plugins/thunderbird: Add more debug messages



commit 183c70644319ee6afa31bffff9377f0fa024592b
Author: Michael Lipp <mnl mnl de>
Date:   Mon Feb 10 09:12:37 2014 +0100

    plugins/thunderbird: Add more debug messages

 src/plugins/thunderbird/chrome/content/bindings.js |    4 ++++
 .../thunderbird/chrome/content/mailstore.js        |   13 +++++--------
 .../thunderbird/chrome/content/persistent-store.js |    9 ++++++++-
 src/plugins/thunderbird/chrome/content/plugin.js   |    3 +++
 src/plugins/thunderbird/chrome/content/queue.js    |    1 +
 .../thunderbird/chrome/content/trackerstore.js     |    6 +++---
 6 files changed, 24 insertions(+), 12 deletions(-)
---
diff --git a/src/plugins/thunderbird/chrome/content/bindings.js 
b/src/plugins/thunderbird/chrome/content/bindings.js
index 4d56747..abc432b 100644
--- a/src/plugins/thunderbird/chrome/content/bindings.js
+++ b/src/plugins/thunderbird/chrome/content/bindings.js
@@ -139,6 +139,7 @@ org.bustany.TrackerBird.TrackerSparql = {
                        ctypes.char.ptr
                );
 
+               dump ("TrackerSparql initialized successfully\n")
                return true;
        },
 
@@ -146,11 +147,14 @@ org.bustany.TrackerBird.TrackerSparql = {
                var tracker = org.bustany.TrackerBird.TrackerSparql;
 
                if (this._connection) {
+                       dump ("TrackerSparql closing connection\n")
                        tracker.object_unref(this._connection);
                }
 
                if (this._lib) {
+                       dump ("TrackerSparql closing library\n")
                        this._lib.close ();
                }
+               dump ("TrackerSparql shut down successfully\n")
        }
 }
diff --git a/src/plugins/thunderbird/chrome/content/mailstore.js 
b/src/plugins/thunderbird/chrome/content/mailstore.js
index 819c576..e0959fe 100644
--- a/src/plugins/thunderbird/chrome/content/mailstore.js
+++ b/src/plugins/thunderbird/chrome/content/mailstore.js
@@ -9,7 +9,7 @@ org.bustany.TrackerBird.MailStore = {
 
        _folderListener: {
                OnItemAdded: function(parentItem, item) {
-                       dump("Item added\n");
+                       dump("Trackerbird: new item to be tracked\n");
                        var store = org.bustany.TrackerBird.MailStore;
                        var hdr = item.QueryInterface(Components.interfaces.nsIMsgDBHdr);
 
@@ -20,7 +20,7 @@ org.bustany.TrackerBird.MailStore = {
                },
 
                OnItemRemoved: function(parentItem, item) {
-                       dump("Item removed\n");
+                       dump("Trackerbird: item to be untracked\n");
                        var store = org.bustany.TrackerBird.MailStore;
                        var hdr = item.QueryInterface(Components.interfaces.nsIMsgDBHdr);
 
@@ -31,27 +31,21 @@ org.bustany.TrackerBird.MailStore = {
                },
 
                OnItemPropertyChanged: function(item, property, oldValue, newValue) {
-                       dump("Item property changed\n");
                },
 
                OnItemIntPropertyChanged: function(item, property, oldValue, newValue) {
-                       dump("Item property changed\n");
                },
 
                OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {
-                       dump("Item property changed\n");
                },
 
                OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue) {
-                       dump("Item property changed\n");
                },
 
                OnItemPropertyFlagChanged: function(header, property, oldValue, newValue) {
-                       dump("Item flag changed\n");
                },
 
                OnItemEvent: function(folder, event) {
-                       dump("Item event " + event + " " + folder + "\n");
                }
        },
 
@@ -63,6 +57,7 @@ org.bustany.TrackerBird.MailStore = {
        _prefs: null,
 
        init: function() {
+               dump ("Trackerbird initializing mailstore...\n")
                // To get notifications
                var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"].
                                  getService(Components.interfaces.nsIMsgMailSession);
@@ -190,9 +185,11 @@ org.bustany.TrackerBird.MailStore = {
        },
 
        shutdown: function() {
+               dump ("Trackerbird mailstore store shutting down...\n")
                var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"].
                                  getService(Components.interfaces.nsIMsgMailSession);
 
                mailSession.Remove(this._folderListener);
+               dump ("Trackerbird mailstore store shut down\n")
        }
 }
diff --git a/src/plugins/thunderbird/chrome/content/persistent-store.js 
b/src/plugins/thunderbird/chrome/content/persistent-store.js
index a0c31f6..77313ae 100644
--- a/src/plugins/thunderbird/chrome/content/persistent-store.js
+++ b/src/plugins/thunderbird/chrome/content/persistent-store.js
@@ -2,6 +2,10 @@ if (!org.bustany.TrackerBird.PersistentStore || !org.bustany.TrackerBird.Persist
 org.bustany.TrackerBird.PersistentStore = {
        // Init barrier
        __initialized: true,
+       __console: 
Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService),
+       _log: function(msg) {
+          this.__console.logStringMessage(msg);
+       },
 
        _schemaVersion: 1,
 
@@ -51,11 +55,13 @@ org.bustany.TrackerBird.PersistentStore = {
                        this.insertSetting("version", this._schemaVersion, true);
                }
 
-
+               dump ("Trackerbird persistent store initialized\n")
+               this._log("trackerbird: persistent store initialized")
                return true;
        },
 
        shutdown: function() {
+               dump ("Trackerbird persistent store shutting down...\n")
                this.endTransaction();
                this._rememberMessageStatement.finalize();
                this._forgetMessageStatement.finalize();
@@ -64,6 +70,7 @@ org.bustany.TrackerBird.PersistentStore = {
                this._updateMetaStatement.finalize();
                this._selectMetaStatement.finalize();
                this._db.close();
+               dump ("Trackerbird persistent store shut down\n")
        },
 
        rememberMessage: function(msg) {
diff --git a/src/plugins/thunderbird/chrome/content/plugin.js 
b/src/plugins/thunderbird/chrome/content/plugin.js
index 64f51f9..02a76e1 100644
--- a/src/plugins/thunderbird/chrome/content/plugin.js
+++ b/src/plugins/thunderbird/chrome/content/plugin.js
@@ -35,6 +35,7 @@ org.bustany.TrackerBird.Plugin = {
                if (this._mailstore) {
                        this._mailstore.shutdown();
                }
+               dump("TrackerBird shut down\n");
        },
 
        initTracker: function() {
@@ -53,10 +54,12 @@ org.bustany.TrackerBird.Plugin = {
                tracker.readyCallback = tracker.AsyncReadyCallback.ptr(callback_closure)
                tracker.connection_open_async(null, tracker.readyCallback, null);
 
+               dump ("Tracker Plugin initialized successfully\n")
                return true;
        },
 
        onTrackerReady: function(source_object, result, user_data) {
+               dump ("Tracker connection opened\n")
                var tracker = org.bustany.TrackerBird.TrackerSparql;
 
         var error = new tracker.Error.ptr;
diff --git a/src/plugins/thunderbird/chrome/content/queue.js b/src/plugins/thunderbird/chrome/content/queue.js
index fb49d34..720b09f 100644
--- a/src/plugins/thunderbird/chrome/content/queue.js
+++ b/src/plugins/thunderbird/chrome/content/queue.js
@@ -6,6 +6,7 @@ org.bustany.TrackerBird.Queue = function(delay) {
        var queue = this;
        this._timerEvent = { notify: function(timer) { queue._active = false; queue.process(); } };
        this._queueTimer = null;
+       dump("Trackerbird created queue with delay " + delay + "\n");
 }
 
 org.bustany.TrackerBird.Queue.prototype.add = function(item) {
diff --git a/src/plugins/thunderbird/chrome/content/trackerstore.js 
b/src/plugins/thunderbird/chrome/content/trackerstore.js
index ee60371..2e6c686 100644
--- a/src/plugins/thunderbird/chrome/content/trackerstore.js
+++ b/src/plugins/thunderbird/chrome/content/trackerstore.js
@@ -60,7 +60,7 @@ org.bustany.TrackerBird.TrackerStore = {
                        return false;
                }
 
-               dump("Inserted message " + uri + "\n");
+               dump("Trackerbird inserted message " + uri + "\n");
                return true;
        },
 
@@ -72,11 +72,11 @@ org.bustany.TrackerBird.TrackerStore = {
 
                if (!this.runTrackerUpdate(query,
                                           100 /* batch */,
-                                          "Cannot delete message from Tracker")) {
+                                          "Trackerbird cannot delete message from Tracker")) {
                        return false;
                }
 
-               dump("Deleted message " + uri + "\n");
+               dump("Trackerbird deleted message " + uri + "\n");
                return true;
        },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]