reduce debug logs

This commit is contained in:
2020-05-20 11:56:43 +08:00
parent 7e01c0bbda
commit 21c93310ea
16 changed files with 73 additions and 13 deletions

View File

@@ -280,14 +280,18 @@ namespace Pixiview.Illust
if (bookmarkId != null)
{
// not exists in remote any more
#if DEBUG
App.DebugPrint($"remove bookmark ({bookmarkId}) - {b.Id}: {b.Title}");
#endif
nows.RemoveAt(i);
}
}
else if (bookmarkId != bookmark.BookmarkId)
{
// update bookmark id
#if DEBUG
App.DebugPrint($"change bookmark ({bookmarkId}) to ({bookmark.BookmarkId}) - {b.Id}: {b.Title}");
#endif
b.BookmarkId = bookmark.BookmarkId;
}
}
@@ -299,7 +303,9 @@ namespace Pixiview.Illust
for (var i = 0; i < list.Length; i++)
{
var item = list[i];
#if DEBUG
App.DebugPrint($"add bookmark ({item.BookmarkId}) - {item.Id}: {item.Title}");
#endif
item.Image = StyleDefinition.DownloadBackground;
}
nows.InsertRange(0, list);

View File

@@ -166,7 +166,9 @@ namespace Pixiview.Illust
if (Columns != columns)
{
Columns = columns;
#if DEBUG
App.DebugPrint($"change columns to {columns}");
#endif
}
}
@@ -521,7 +523,9 @@ namespace Pixiview.Illust
protected void DoLoadIllusts(bool force = false, bool bottom = false)
{
#if DEBUG
App.DebugPrint($"start loading data, force: {force}");
#endif
illustData = DoLoadIllustData(force);
if (illustData == null)
{
@@ -702,7 +706,9 @@ namespace Pixiview.Illust
if (CheckRefresh())
{
lastRefreshY = y;
#if DEBUG
App.DebugPrint("start to load next page");
#endif
StartLoad(true, true);
}
}

View File

@@ -320,7 +320,9 @@ namespace Pixiview.Illust
if (nextPage == currentPage + 1)
{
currentPage = nextPage;
#if DEBUG
App.DebugPrint($"loading page {nextPage}");
#endif
return true;
}
return false;
@@ -353,7 +355,9 @@ namespace Pixiview.Illust
{
// query changed.
lastQueryKey = query;
#if DEBUG
App.DebugPrint($"query changed: {query}");
#endif
PrepareLoad();
}
}

View File

@@ -190,7 +190,9 @@ namespace Pixiview.Illust
if (UserColumns != columns)
{
UserColumns = columns;
#if DEBUG
App.DebugPrint($"change user columns to {columns}");
#endif
}
}

View File

@@ -64,7 +64,9 @@ namespace Pixiview.Illust
if (ids.Length == 0 || nextIndex >= illustIds.Length)
{
// done
#if DEBUG
App.DebugPrint($"download completed: {startIndex}");
#endif
startIndex = nextIndex;
}
}

View File

@@ -61,7 +61,9 @@ namespace Pixiview.Illust
return null;
}
illustIds = init.body.illusts.Keys.OrderByDescending(i => int.TryParse(i, out int id) ? id : -1).ToArray();
#if DEBUG
App.DebugPrint($"user has ({illustIds.Length}) illusts.");
#endif
startIndex = 0;
}
@@ -75,7 +77,9 @@ namespace Pixiview.Illust
if (ids.Length == 0 || nextIndex >= illustIds.Length)
{
// done
#if DEBUG
App.DebugPrint($"download completed: {startIndex}");
#endif
startIndex = nextIndex;
}
return data;

View File

@@ -353,7 +353,9 @@ namespace Pixiview.Illust
var reload = false;
if (pages.body.Length > items.Length)
{
#if DEBUG
App.DebugPrint($"local page count ({items.Length}) is not equals the remote one ({pages.body.Length})");
#endif
var tmp = new IllustDetailItem[pages.body.Length];
items.CopyTo(items, 0);
#if __IOS__
@@ -430,7 +432,9 @@ namespace Pixiview.Illust
{
if (item.Loading || item.Image != null)
{
#if DEBUG
App.DebugPrint($"skipped, loading or already loaded, index: {index}, loading: {item.Loading}");
#endif
return;
}
}