From 8bb932a16699c84786cc93d8bdf6395f1705f3b4 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 24 Jun 2015 19:08:26 +0200 Subject: [PATCH] Try to fix logging --- paket.lock | 6 +++--- src/Paket.VisualStudio/Commands/AddPackageProcess.cs | 7 ++++--- .../Commands/PackageGui/AddPackage.xaml.cs | 3 ++- .../Commands/PackageGui/AddPackageViewModel.cs | 8 ++++---- src/Paket.VisualStudio/PaketOutputPane.cs | 2 +- src/Paket.VisualStudio/source.extension.vsixmanifest | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/paket.lock b/paket.lock index 78b233073..0cba5a9dd 100644 --- a/paket.lock +++ b/paket.lock @@ -6,7 +6,7 @@ NUGET Selenium.Support (2.46.0) Selenium.WebDriver (2.46.0) SizSelCsZzz (0.3.36.0) - FAKE (3.35.2) + FAKE (3.35.4) FSharp.Compiler.Service (0.0.90) FSharp.Core (3.1.2.1) FSharp.Formatting (2.9.9) @@ -25,7 +25,7 @@ NUGET Newtonsoft.Json (7.0.1) Octokit (0.13.0) Microsoft.Net.Http - Paket.Core (1.18.0) + Paket.Core (1.18.2) FSharp.Core Newtonsoft.Json reactiveui (6.5.0) @@ -127,5 +127,5 @@ NUGET GITHUB remote: fsharp/FAKE specs: - modules/Octokit/Octokit.fsx (52ee2053781c7106766d2b23686344f70dc11483) + modules/Octokit/Octokit.fsx (98d8f2e57e8f9972703d4237dd62f8e13d6b8d7d) Octokit \ No newline at end of file diff --git a/src/Paket.VisualStudio/Commands/AddPackageProcess.cs b/src/Paket.VisualStudio/Commands/AddPackageProcess.cs index 7f2c81928..62e18758d 100644 --- a/src/Paket.VisualStudio/Commands/AddPackageProcess.cs +++ b/src/Paket.VisualStudio/Commands/AddPackageProcess.cs @@ -32,13 +32,14 @@ public static void ShowAddPackageDialog(string selectedFileName, string projectG var secondWindow = new AddPackage(); //Create observable paket trace - var paketTraceObs = Observable.Create(observer => + var paketTraceObs = Observable.Create(observer => { - Paket.Logging.RegisterTraceFunction(observer.OnNext); + Paket.Logging.@event.Publish.Subscribe(x => observer.OnNext(x)); return Disposable.Create(() => { - Paket.Logging.RemoveTraceFunction(observer.OnNext); + }); + }); Action addPackageToDependencies = result => diff --git a/src/Paket.VisualStudio/Commands/PackageGui/AddPackage.xaml.cs b/src/Paket.VisualStudio/Commands/PackageGui/AddPackage.xaml.cs index cec7053fb..ec78e5fe1 100644 --- a/src/Paket.VisualStudio/Commands/PackageGui/AddPackage.xaml.cs +++ b/src/Paket.VisualStudio/Commands/PackageGui/AddPackage.xaml.cs @@ -94,6 +94,7 @@ public AddPackage() //Listen to the paket trace and put it in the dialog box ViewModel.PaketTrace .ObserveOn(RxApp.MainThreadScheduler) + .Select(x => x.Text) .Subscribe(AppendMessageToOutputbox) .AddTo(_compositeDisposable); @@ -164,7 +165,7 @@ public DesignTimeViewModel() public ReactiveCommand AddPackage { get; private set; } - public IObservable PaketTrace { get; private set; } + public IObservable PaketTrace { get; private set; } public LoadingState AddPackageState { get; private set; } } } diff --git a/src/Paket.VisualStudio/Commands/PackageGui/AddPackageViewModel.cs b/src/Paket.VisualStudio/Commands/PackageGui/AddPackageViewModel.cs index 9df60cc52..c100c64ee 100644 --- a/src/Paket.VisualStudio/Commands/PackageGui/AddPackageViewModel.cs +++ b/src/Paket.VisualStudio/Commands/PackageGui/AddPackageViewModel.cs @@ -19,7 +19,7 @@ public interface IAddPackageViewModel ReactiveCommand SearchNuget { get; } ReactiveCommand AddPackage { get; } - IObservable PaketTrace { get; } + IObservable PaketTrace { get; } LoadingState AddPackageState { get; } } @@ -38,9 +38,9 @@ public enum LoadingState public class AddPackageViewModel : ReactiveObject, IAddPackageViewModel { private readonly Paket.Dependencies _dependenciesFile; - private readonly IObservable _paketTraceFunObservable; + private readonly IObservable _paketTraceFunObservable; - public IObservable PaketTrace + public IObservable PaketTrace { get { return _paketTraceFunObservable; } } @@ -82,7 +82,7 @@ public LoadingState AddPackageState public AddPackageViewModel( Func> searchForPackages, Action addPackageCallback, - IObservable paketTraceFunObservable) + IObservable paketTraceFunObservable) { var logger = new DebugLogger() {Level = LogLevel.Debug}; diff --git a/src/Paket.VisualStudio/PaketOutputPane.cs b/src/Paket.VisualStudio/PaketOutputPane.cs index d8c01b880..f15eae7a0 100644 --- a/src/Paket.VisualStudio/PaketOutputPane.cs +++ b/src/Paket.VisualStudio/PaketOutputPane.cs @@ -36,7 +36,7 @@ internal static IVsOutputWindowPane OutputPane OutputWindow.CreatePane(ref generalPaneGuid, PaneName, 1, 1); OutputWindow.GetPane(ref generalPaneGuid, out pane); - Paket.Logging.RegisterTraceFunction(text => { OutputPane.OutputStringThreadSafe(text + "\r\n"); }); + Paket.Logging.@event.Publish.Subscribe(text => OutputPane.OutputStringThreadSafe(text + "\r\n")); } _outputPane = pane; diff --git a/src/Paket.VisualStudio/source.extension.vsixmanifest b/src/Paket.VisualStudio/source.extension.vsixmanifest index 728879e31..6d7263f33 100644 --- a/src/Paket.VisualStudio/source.extension.vsixmanifest +++ b/src/Paket.VisualStudio/source.extension.vsixmanifest @@ -3,7 +3,7 @@ Paket for Visual Studio Igal Tabachnik - 0.4.4 + 0.4.5 Manage your Paket dependencies from Visual Studio! 1033 License.txt