Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeric-X committed Oct 1, 2024
1 parent 381221e commit 841461b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SyncClipboard.Core/Clipboard/Profile/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task SetLocalClipboard(bool notify, CancellationToken ctk, bool mut
await ClipboardSetter.SetLocalClipboard(MetaInfomation, ctk);
if (notify && EnableNotify)
{
await Logger.WriteAsync("System notification has sent.");
Logger.Write("System notification has sent.");
SetNotification(NotificationManager);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ public ProgressToastReporter(string filename, string title, INotification notifi
_progressBar.ProgressValueTip = I18n.Strings.Preparing;
_progressBar.Buttons = buttons.ToList();

AppCore.Current.Logger.Write("ProgressToastReporter created");
_progressBar.ShowSilent();
_counter = new Counter((_) => _progressBar.Upadate(), 500, ulong.MaxValue);
}

public void Cancel()
{
AppCore.Current.Logger.Write("ProgressToastReporter status set to cancel");
_counter.Cancle();
_progressBar.ProgressValueTip = I18n.Strings.Canceled;
_progressBar.Upadate();
}

public void CancelSicent()
{
AppCore.Current.Logger.Write("ProgressToastReporter canceled sicently");
_counter.Cancle();
_progressBar.Remove();
}
Expand All @@ -45,6 +48,7 @@ public void Report(HttpDownloadProgress progress)
_progressBar.ProgressValueTip = percent?.ToString("P");
if (progress.End)
{
AppCore.Current.Logger.Write("ProgressToastReporter removed due to complete");
_counter.Cancle();
_progressBar.Remove();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ protected override async Task HandleClipboard(ClipboardMetaInfomation meta, Prof
{
_logger.Write(LOG_TAG, "New Push started, meta: " + meta);
PushStarted?.Invoke();
using var guard = new ScopeGuard(() => PushStopped?.Invoke());
using var guard = new ScopeGuard(() =>
{
_logger.Write(LOG_TAG, "Push End");
PushStopped?.Invoke();
});

await SyncService.remoteProfilemutex.WaitAsync(token);
try
Expand Down

0 comments on commit 841461b

Please sign in to comment.