Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeric-X committed Sep 21, 2024
1 parent 2eeb790 commit 381221e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ private async void StartPullLoop()
_cancelSource = new CancellationTokenSource();
try
{
_logger.Write(LOG_TAG, "Loop start");
await PullLoop(_cancelSource.Token);
_logger.Write(LOG_TAG, "Loop exit normally");
}
catch (OperationCanceledException)
{
Expand All @@ -233,7 +235,7 @@ private async void StartPullLoop()
}
catch (Exception ex)
{
_logger.Write(LOG_TAG, ex.Message);
_logger.Write(LOG_TAG, "Exit with exception" + ex.Message);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ private async Task<bool> IsObsoleteMeta(ClipboardMetaInfomation meta, Cancellati

protected override async Task HandleClipboard(ClipboardMetaInfomation meta, Profile profile, CancellationToken token)
{
_logger.Write(LOG_TAG, "New Push started, meta: " + meta);
PushStarted?.Invoke();
using var guard = new ScopeGuard(() => PushStopped?.Invoke());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SyncClipboard.Core.Clipboard;
using SyncClipboard.Core;
using SyncClipboard.Core.Clipboard;
using SyncClipboard.Core.Models;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -31,6 +32,7 @@ private static async Task SetPackageToClipboard(DataPackage package, Cancellatio

public async Task SetLocalClipboard(ClipboardMetaInfomation metaInfomation, CancellationToken ctk)
{
AppCore.Current.Logger.Write("Clip Setter", "Clipboard setted, meta: " + metaInfomation);
await ClipboardSetterBase<ProfileType>.SetPackageToClipboard(await CreatePackage(metaInfomation), ctk);
}
}

0 comments on commit 381221e

Please sign in to comment.