[banshee] [Dap] Add some logging for the start/end of sync processes



commit e7058d5bd2cdf6ffefa9a32877b15bf62e2655a5
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Thu Sep 9 04:37:40 2010 +0200

    [Dap] Add some logging for the start/end of sync processes
    
    This adds calls to Hyena.Log.Debug when the DapSync process starts
    and ends, as well as logging for the Sync Thread Cycle of the iPod
    and AppleDevice extensions. Useful for measuring times in search
    for performance problems, or just general helpful verbose output
    that gets added to the logs that may be attached to bug reports.
    
    Signed-off-by: Alexander Kojevnikov <alexander kojevnikov com>

 .../Banshee.Dap.AppleDevice/AppleDeviceSource.cs   |    4 ++++
 .../Banshee.Dap.Ipod/IpodSource.cs                 |    3 +++
 src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs  |    4 ++++
 3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
index 9558ff4..e9c4b19 100644
--- a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
+++ b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
@@ -485,6 +485,8 @@ namespace Banshee.Dap.AppleDevice
 
         private void PerformSyncThreadCycle ()
         {
+            Hyena.Log.Debug ("Starting AppleDevice sync thread cycle");
+
             string message;
             int total;
             var progressUpdater = new UserJob (Catalog.GetString ("Syncing iPod"),
@@ -573,6 +575,8 @@ namespace Banshee.Dap.AppleDevice
                 Log.Exception ("Failed to save iPod database", e);
             }
             progressUpdater.Finish ();
+
+            Hyena.Log.Debug ("Ending AppleDevice sync thread cycle");
         }
 
         public bool SyncNeeded {
diff --git a/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs b/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
index fb914fc..bfff817 100644
--- a/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
+++ b/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
@@ -560,6 +560,8 @@ namespace Banshee.Dap.Ipod
 
         private void PerformSyncThreadCycle ()
         {
+            Hyena.Log.Debug ("Starting iPod sync thread cycle");
+
             while (tracks_to_add.Count > 0) {
                 IpodTrackInfo track = null;
                 lock (sync_mutex) {
@@ -639,6 +641,7 @@ namespace Banshee.Dap.Ipod
                 ipod_device.TrackDatabase.SaveStarted -= OnIpodDatabaseSaveStarted;
                 ipod_device.TrackDatabase.SaveEnded -= OnIpodDatabaseSaveEnded;
                 ipod_device.TrackDatabase.SaveProgressChanged -= OnIpodDatabaseSaveProgressChanged;
+                Hyena.Log.Debug ("Ending iPod sync thread cycle");
             }
         }
 
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
index 2930cfc..ac8f164 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
@@ -211,6 +211,8 @@ namespace Banshee.Dap
                     throw new PossibleUserErrorException (to_remove.Count);
                 }
 
+                Hyena.Log.Debug ("Starting DAP sync");
+
                 sync.Dap.DeleteAllTracks (to_remove);
                 sync.Dap.AddAllTracks (to_add);
 
@@ -244,6 +246,8 @@ namespace Banshee.Dap
                     }
                 }
 
+                Hyena.Log.Debug ("Ending DAP sync");
+
                 CalculateSync ();
                 sync.OnUpdated ();
             }



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