Skip to content
Browse files

Removed all NLog references and implemented a system similar to

Caliburn.Micro's way of doing logging.

This is partially distantcam's code and partially mine - thanks for the
commit!
  • Loading branch information...
1 parent 3132ff3 commit 2ae9e7831326ce7875014e2833cc3e2179686ea8 @distantcam distantcam committed with paulcbetts Jun 21, 2012
Showing with 532 additions and 155 deletions.
  1. BIN MakeRelease.ps1
  2. +1 −4 PerfConsoleRunner/PerfConsoleRunner.csproj
  3. +0 −3 ReactiveUI.Blend/ReactiveUI.Blend.csproj
  4. +0 −3 ReactiveUI.Blend/ReactiveUI.Blend_WP7.csproj
  5. +0 −6 ReactiveUI.Routing.Tests/ReactiveUI.Routing.Tests.csproj
  6. +0 −4 ReactiveUI.Routing.Tests/packages.config
  7. +0 −3 ReactiveUI.Routing/ReactiveUI.Routing.csproj
  8. +2 −3 ReactiveUI.Routing/ReactiveUI.Routing_Mono.csproj
  9. +0 −4 ReactiveUI.Routing/ReactiveUI.Routing_SL5.csproj
  10. +0 −3 ReactiveUI.Routing/ReactiveUI.Routing_WP7.csproj
  11. +1 −4 ReactiveUI.Sample/ReactiveUI.Sample.Tests/ReactiveUI.Sample.Tests.csproj
  12. +0 −3 ReactiveUI.Sample/ReactiveUI.Sample/ReactiveUI.Sample.csproj
  13. +1 −4 ReactiveUI.Serialization.Esent/ReactiveUI.Serialization.Esent.csproj
  14. +1 −4 ReactiveUI.Serialization.Tests/ReactiveUI.Serialization.Tests.csproj
  15. +0 −3 ReactiveUI.Serialization.Tests/ReactiveUI.Serialization.Tests_SL5.csproj
  16. +1 −4 ReactiveUI.Serialization/ReactiveUI.Serialization.csproj
  17. +1 −4 ReactiveUI.Serialization/ReactiveUI.Serialization_SL5.csproj
  18. +0 −3 ReactiveUI.Serialization/ReactiveUI.Serialization_WP7.csproj
  19. +0 −3 ReactiveUI.Testing/ReactiveUI.Testing.csproj
  20. +0 −3 ReactiveUI.Testing/ReactiveUI.Testing_Mono.csproj
  21. +0 −3 ReactiveUI.Testing/ReactiveUI.Testing_WP7.csproj
  22. +0 −3 ReactiveUI.Tests/ReactiveUI.Tests.csproj
  23. +0 −3 ReactiveUI.Tests/ReactiveUI.Tests_Mono.csproj
  24. +0 −1 ReactiveUI.Xaml/ReactiveAsyncCommand.cs
  25. +0 −1 ReactiveUI.Xaml/ReactiveCommand.cs
  26. +0 −6 ReactiveUI.Xaml/ReactiveUI.Xaml.csproj
  27. +0 −6 ReactiveUI.Xaml/ReactiveUI.Xaml_Mono.csproj
  28. +2 −3 ReactiveUI.Xaml/ReactiveUI.Xaml_SL5.csproj
  29. +0 −3 ReactiveUI.Xaml/ReactiveUI.Xaml_WP7.csproj
  30. +0 −4 ReactiveUI.Xaml/packages.config
  31. +510 −25 ReactiveUI/Logging.cs
  32. +0 −1 ReactiveUI/MakeObjectReactiveHelper.cs
  33. +0 −1 ReactiveUI/MessageBus.cs
  34. +0 −1 ReactiveUI/ObservableAsPropertyHelper.cs
  35. +0 −1 ReactiveUI/ObservableAsyncMRUCache.cs
  36. +0 −1 ReactiveUI/ReactiveCollection.cs
  37. +0 −1 ReactiveUI/ReactiveObject.cs
  38. +0 −4 ReactiveUI/ReactiveUI.csproj
  39. +0 −3 ReactiveUI/ReactiveUI_Mono.csproj
  40. +0 −3 ReactiveUI/ReactiveUI_SL5.csproj
  41. +0 −3 ReactiveUI/ReactiveUI_WP7.csproj
  42. +0 −1 ReactiveUI/ReactiveUI_WinRT.csproj
  43. +12 −2 ReactiveUI/RxApp.cs
  44. +0 −1 ReactiveUI/Validation.cs
  45. +0 −4 ReactiveUI/packages.config
  46. +0 −2 packages/repositories.config
View
BIN MakeRelease.ps1
Binary file not shown.
View
5 PerfConsoleRunner/PerfConsoleRunner.csproj
@@ -35,9 +35,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -79,4 +76,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
3 ReactiveUI.Blend/ReactiveUI.Blend.csproj
@@ -42,9 +42,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
View
3 ReactiveUI.Blend/ReactiveUI.Blend_WP7.csproj
@@ -47,9 +47,6 @@
</Reference>
<Reference Include="Microsoft.Expression.Interactions, Version=3.7.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="mscorlib.Extensions" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4-windowsphone71\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Observable" />
<Reference Include="System.Reactive.Core, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
View
6 ReactiveUI.Routing.Tests/ReactiveUI.Routing.Tests.csproj
@@ -35,9 +35,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
@@ -97,9 +94,6 @@
<Name>ReactiveUI</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
4 ReactiveUI.Routing.Tests/packages.config
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="NLog" version="2.0.0.2000" />
-</packages>
View
3 ReactiveUI.Routing/ReactiveUI.Routing.csproj
@@ -35,9 +35,6 @@
<Reference Include="Microsoft.Practices.ServiceLocation">
<HintPath>..\ext\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
View
5 ReactiveUI.Routing/ReactiveUI.Routing_Mono.csproj
@@ -39,11 +39,10 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Reactive.Core">
<HintPath>..\ext\System.Reactive.Core.dll</HintPath>
+ <Reference Include="System.Reactive">
+ <HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Interfaces">
<HintPath>..\ext\System.Reactive.Interfaces.dll</HintPath>
View
4 ReactiveUI.Routing/ReactiveUI.Routing_SL5.csproj
@@ -56,10 +56,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4\NLog.dll</HintPath>
- </Reference>
-
<Reference Include="System.Reactive.Core, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\SL5\System.Reactive.Core.dll</HintPath>
View
3 ReactiveUI.Routing/ReactiveUI.Routing_WP7.csproj
@@ -70,9 +70,6 @@
<HintPath>..\ext\WP71\AsyncCtpLibrary_Phone.dll</HintPath>
</Reference>
<Reference Include="mscorlib.Extensions" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl3-wp\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Observable" />
<Reference Include="System.Reactive.Core, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
View
5 ReactiveUI.Sample/ReactiveUI.Sample.Tests/ReactiveUI.Sample.Tests.csproj
@@ -38,9 +38,6 @@
<HintPath>..\..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
@@ -101,4 +98,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
3 ReactiveUI.Sample/ReactiveUI.Sample/ReactiveUI.Sample.csproj
@@ -60,9 +60,6 @@
<Reference Include="Microsoft.Reactive.Testing">
<HintPath>..\..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
View
5 ReactiveUI.Serialization.Esent/ReactiveUI.Serialization.Esent.csproj
@@ -38,9 +38,6 @@
<Reference Include="Esent.Interop">
<HintPath>..\ext\Esent.Interop.dll</HintPath>
</Reference>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
@@ -77,4 +74,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
5 ReactiveUI.Serialization.Tests/ReactiveUI.Serialization.Tests.csproj
@@ -63,9 +63,6 @@
<Reference Include="Microsoft.Moles.Framework, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Pex.Framework, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Pex.Linq, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="ReactiveUI.Serialization.Moles, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="ReactiveXaml.Serialization.Moles, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="System" />
@@ -151,4 +148,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
3 ReactiveUI.Serialization.Tests/ReactiveUI.Serialization.Tests_SL5.csproj
@@ -82,9 +82,6 @@
<Reference Include="Newtonsoft.Json.Silverlight">
<HintPath>..\ext\SL5\Newtonsoft.Json.Silverlight.dll</HintPath>
</Reference>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.ComponentModel.DataAnnotations, Version=5.0.5.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217, processorArchitecture=MSIL" />
<Reference Include="System.Reactive">
<HintPath>..\ext\SL5\System.Reactive.dll</HintPath>
View
5 ReactiveUI.Serialization/ReactiveUI.Serialization.csproj
@@ -35,9 +35,6 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\ext\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
@@ -80,4 +77,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
5 ReactiveUI.Serialization/ReactiveUI.Serialization_SL5.csproj
@@ -59,9 +59,6 @@
<Reference Include="Newtonsoft.Json.Silverlight">
<HintPath>..\ext\SL5\Newtonsoft.Json.Silverlight.dll</HintPath>
</Reference>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.ComponentModel.DataAnnotations, Version=5.0.5.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217, processorArchitecture=MSIL" />
<Reference Include="System.Reactive">
<HintPath>..\ext\SL5\System.Reactive.dll</HintPath>
@@ -112,4 +109,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
3 ReactiveUI.Serialization/ReactiveUI.Serialization_WP7.csproj
@@ -69,9 +69,6 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.4.5.1\lib\sl4-windowsphone71\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4-windowsphone71\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Observable" />
<Reference Include="System.Reactive.Core">
<HintPath>..\ext\WP71\System.Reactive.Core.dll</HintPath>
View
3 ReactiveUI.Testing/ReactiveUI.Testing.csproj
@@ -95,9 +95,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
View
3 ReactiveUI.Testing/ReactiveUI.Testing_Mono.csproj
@@ -97,9 +97,6 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Reactive.Core">
<HintPath>..\ext\System.Reactive.Core.dll</HintPath>
</Reference>
View
3 ReactiveUI.Testing/ReactiveUI.Testing_WP7.csproj
@@ -68,9 +68,6 @@
<ItemGroup>
<Reference Include="Microsoft.Reactive.Testing, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="mscorlib.Extensions" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4-windowsphone71\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Observable" />
<Reference Include="Microsoft.Reactive.Testing, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
View
3 ReactiveUI.Tests/ReactiveUI.Tests.csproj
@@ -46,9 +46,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
View
3 ReactiveUI.Tests/ReactiveUI.Tests_Mono.csproj
@@ -55,9 +55,6 @@
<Reference Include="xunit.extensions">
<HintPath>..\ext\xunit\xunit.extensions.dll</HintPath>
</Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ErrorsTest.cs" />
View
1 ReactiveUI.Xaml/ReactiveAsyncCommand.cs
@@ -7,7 +7,6 @@
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Reactive.Threading.Tasks;
-using NLog;
using ReactiveUI;
using System.Threading.Tasks;
View
1 ReactiveUI.Xaml/ReactiveCommand.cs
@@ -7,7 +7,6 @@
using System.Reactive.Threading.Tasks;
using System.Threading.Tasks;
using System.Windows.Input;
-using NLog;
using ReactiveUI;
namespace ReactiveUI.Xaml
View
6 ReactiveUI.Xaml/ReactiveUI.Xaml.csproj
@@ -94,9 +94,6 @@
<NoWarn>1591, 1573, 1711, 1587, 1570, 1572</NoWarn>
</PropertyGroup>
<ItemGroup>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="PresentationFramework.Aero" />
@@ -151,9 +148,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
View
6 ReactiveUI.Xaml/ReactiveUI.Xaml_Mono.csproj
@@ -89,9 +89,6 @@
<DocumentationFile>bin\Release\Mono\ReactiveUI.Xaml.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
@@ -134,9 +131,6 @@
<Compile Include="SampleDataBinder.cs" />
<Compile Include="ServiceLocationRegistration.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
5 ReactiveUI.Xaml/ReactiveUI.Xaml_SL5.csproj
@@ -56,9 +56,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Reactive.Core, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -81,6 +78,8 @@
<HintPath>..\ext\SL5\System.Reactive.Windows.Threading.dll</HintPath>
</Reference>
+ <Reference Include="System.Reactive, Version=1.1.11111.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Reactive.Windows.Threading, Version=1.1.11111.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Windows" />
<Reference Include="system" />
View
3 ReactiveUI.Xaml/ReactiveUI.Xaml_WP7.csproj
@@ -70,9 +70,6 @@
<HintPath>..\ext\WP71\AsyncCtpLibrary_Phone.dll</HintPath>
</Reference>
<Reference Include="mscorlib.Extensions" />
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4-windowsphone71\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Observable" />
<Reference Include="System.Reactive.Core, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
View
4 ReactiveUI.Xaml/packages.config
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="NLog" version="2.0.0.2000" />
-</packages>
View
535 ReactiveUI/Logging.cs
@@ -1,43 +1,148 @@
using System;
+using System.ComponentModel;
using System.Reactive.Linq;
using System.Reflection;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.Diagnostics.Contracts;
-using NLog;
-using NLog.Config;
-using NLog.Targets;
namespace ReactiveUI
{
- /// <summary>
- /// "Implement" this interface in your class to get access to the Log()
- /// Mixin, which will give you a Logger that includes the class name in the
- /// log.
- /// </summary>
- public interface IEnableLogger { }
+ public enum LogLevel {
+ Debug = 1, Info, Warn, Error, Fatal,
+ }
- public static class LogHost
+ public interface IRxUILogger
+ {
+ void Write([Localizable(false)] string message, LogLevel logLevel);
+ LogLevel Level { get; set; }
+ }
+
+ public interface IRxUIFullLogger : IRxUILogger
+ {
+ void Debug<T>(T value);
+ void Debug<T>(IFormatProvider formatProvider, T value);
+ void DebugException([Localizable(false)] string message, Exception exception);
+ void Debug(IFormatProvider formatProvider, [Localizable(false)] string message, params object[] args);
+ void Debug([Localizable(false)] string message);
+ void Debug([Localizable(false)] string message, params object[] args);
+ void Debug<TArgument>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument argument);
+ void Debug<TArgument>([Localizable(false)] string message, TArgument argument);
+ void Debug<TArgument1, TArgument2>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Debug<TArgument1, TArgument2>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Debug<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+ void Debug<TArgument1, TArgument2, TArgument3>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+
+ void Info<T>(T value);
+ void Info<T>(IFormatProvider formatProvider, T value);
+ void InfoException([Localizable(false)] string message, Exception exception);
+ void Info(IFormatProvider formatProvider, [Localizable(false)] string message, params object[] args);
+ void Info([Localizable(false)] string message);
+ void Info([Localizable(false)] string message, params object[] args);
+ void Info<TArgument>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument argument);
+ void Info<TArgument>([Localizable(false)] string message, TArgument argument);
+ void Info<TArgument1, TArgument2>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Info<TArgument1, TArgument2>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Info<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+ void Info<TArgument1, TArgument2, TArgument3>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+
+ void Warn<T>(T value);
+ void Warn<T>(IFormatProvider formatProvider, T value);
+ void WarnException([Localizable(false)] string message, Exception exception);
+ void Warn(IFormatProvider formatProvider, [Localizable(false)] string message, params object[] args);
+ void Warn([Localizable(false)] string message);
+ void Warn([Localizable(false)] string message, params object[] args);
+ void Warn<TArgument>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument argument);
+ void Warn<TArgument>([Localizable(false)] string message, TArgument argument);
+ void Warn<TArgument1, TArgument2>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Warn<TArgument1, TArgument2>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Warn<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+ void Warn<TArgument1, TArgument2, TArgument3>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+
+ void Error<T>(T value);
+ void Error<T>(IFormatProvider formatProvider, T value);
+ void ErrorException([Localizable(false)] string message, Exception exception);
+ void Error(IFormatProvider formatProvider, [Localizable(false)] string message, params object[] args);
+ void Error([Localizable(false)] string message);
+ void Error([Localizable(false)] string message, params object[] args);
+ void Error<TArgument>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument argument);
+ void Error<TArgument>([Localizable(false)] string message, TArgument argument);
+ void Error<TArgument1, TArgument2>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Error<TArgument1, TArgument2>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Error<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+ void Error<TArgument1, TArgument2, TArgument3>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+
+ void Fatal<T>(T value);
+ void Fatal<T>(IFormatProvider formatProvider, T value);
+ void FatalException([Localizable(false)] string message, Exception exception);
+ void Fatal(IFormatProvider formatProvider, [Localizable(false)] string message, params object[] args);
+ void Fatal([Localizable(false)] string message);
+ void Fatal([Localizable(false)] string message, params object[] args);
+ void Fatal<TArgument>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument argument);
+ void Fatal<TArgument>([Localizable(false)] string message, TArgument argument);
+ void Fatal<TArgument1, TArgument2>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Fatal<TArgument1, TArgument2>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2);
+ void Fatal<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, [Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+ void Fatal<TArgument1, TArgument2, TArgument3>([Localizable(false)] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3);
+ }
+
+ public static class LogManager
{
- static LogHost()
+ static LogManager()
{
-#if !WINRT
- if (LogManager.Configuration == null)
- {
- var target = new ConsoleTarget() { Layout = "${level:uppercase=true} ${logger}: ${message}${onexception:inner=${newline}${exception:format=tostring}}" };
- var config = new LoggingConfiguration();
+ RxApp._LoggerFactoryChanged.Subscribe(_ => loggerCache.InvalidateAll());
+ }
+
+ static MemoizingMRUCache<Type, IRxUIFullLogger> loggerCache = new MemoizingMRUCache<Type, IRxUIFullLogger>((type, _) => {
+ var ret = RxApp.LoggerFactory(type);
+ var fullRet = ret as IRxUIFullLogger;
- config.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, target));
- LogManager.Configuration = config;
+ if (fullRet != null) return fullRet;
+ return new WrappingFullLogger(ret, type);
+ }, 30);
- LogHost.Default.Info("*** NLog was not configured, setting up a default configuration ***");
+ public static IRxUIFullLogger GetLogger(Type type)
+ {
+ lock (loggerCache) {
+ return loggerCache.Get(type);
}
-#endif
}
+ public static IRxUIFullLogger GetLogger<T>()
+ {
+ return GetLogger(typeof(T));
+ }
+ }
+
+ public class NullLogger : IRxUILogger
+ {
+ public void Write(string message, LogLevel logLevel) {}
+ public LogLevel Level { get; set; }
+ }
+
+ public class DebugLogger : IRxUILogger
+ {
+ public void Write(string message, LogLevel logLevel)
+ {
+ if ((int)logLevel < (int)Level) return;
+ Debug.WriteLine(message);
+ }
+ public LogLevel Level { get; set; }
+ }
+
+
+ /// <summary>
+ /// "Implement" this interface in your class to get access to the Log()
+ /// Mixin, which will give you a Logger that includes the class name in the
+ /// log.
+ /// </summary>
+ public interface IEnableLogger { }
+
+ public static class LogHost
+ {
#if WINRT
public static dynamic Default {
get { return LogManager.GetLogger("Logger"); }
@@ -52,17 +157,17 @@ static LogHost()
/// Use this logger inside miscellaneous static methods where creating
/// a class-specific logger isn't really worth it.
/// </summary>
- public static Logger Default {
- get { return LogManager.GetLogger("Logger"); }
+ public static IRxUIFullLogger Default {
+ get { return LogManager.GetLogger(typeof(LogHost)); }
}
/// <summary>
/// Call this method to write log entries on behalf of the current
/// class.
/// </summary>
- public static Logger Log<T>(this T This) where T : IEnableLogger
+ public static IRxUIFullLogger Log<T>(this T This) where T : IEnableLogger
{
- return LogManager.GetLogger(typeof(T).FullName);
+ return LogManager.GetLogger(typeof(T));
}
#endif
}
@@ -110,6 +215,386 @@ public static class ObservableLoggingMixin
});
}
}
+
+ #region Extremely Dull Code Ahead
+ internal class WrappingFullLogger : IRxUIFullLogger
+ {
+ readonly IRxUILogger _inner;
+ readonly string prefix;
+ readonly MethodInfo stringFormat;
+
+ public WrappingFullLogger(IRxUILogger inner, Type callingType)
+ {
+ _inner = inner;
+ prefix = String.Format(CultureInfo.InvariantCulture, "{0}: ", callingType.Name);
+
+ stringFormat = typeof (String).GetMethod("Format", new[] {typeof (IFormatProvider), typeof (string), typeof (object[])});
+ Contract.Requires(stringFormat != null);
+ }
+
+ public void Debug<T>(T value)
+ {
+ _inner.Write(prefix + value, LogLevel.Debug);
+ }
+
+ public void Debug<T>(IFormatProvider formatProvider, T value)
+ {
+ _inner.Write(String.Format(formatProvider, "{0}{1}", prefix, value), LogLevel.Debug);
+ }
+
+ public void DebugException(string message, Exception exception)
+ {
+ _inner.Write(String.Format("{0}{1}: {2}", prefix, message, exception), LogLevel.Debug);
+ }
+
+ public void Debug(IFormatProvider formatProvider, string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = formatProvider; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Debug);
+ }
+
+ public void Debug(string message)
+ {
+ _inner.Write(prefix + message, LogLevel.Debug);
+ }
+
+ public void Debug(string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = CultureInfo.InvariantCulture; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Debug);
+ }
+
+ public void Debug<TArgument>(IFormatProvider formatProvider, string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument), LogLevel.Debug);
+ }
+
+ public void Debug<TArgument>(string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument), LogLevel.Debug);
+ }
+
+ public void Debug<TArgument1, TArgument2>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Debug);
+ }
+
+ public void Debug<TArgument1, TArgument2>(string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Debug);
+ }
+
+ public void Debug<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Debug);
+ }
+
+ public void Debug<TArgument1, TArgument2, TArgument3>(string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Debug);
+ }
+
+ public void Info<T>(T value)
+ {
+ _inner.Write(prefix + value, LogLevel.Info);
+ }
+
+ public void Info<T>(IFormatProvider formatProvider, T value)
+ {
+ _inner.Write(String.Format(formatProvider, "{0}{1}", prefix, value), LogLevel.Info);
+ }
+
+ public void InfoException(string message, Exception exception)
+ {
+ _inner.Write(String.Format("{0}{1}: {2}", prefix, message, exception), LogLevel.Info);
+ }
+
+ public void Info(IFormatProvider formatProvider, string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = formatProvider; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Info);
+ }
+
+ public void Info(string message)
+ {
+ _inner.Write(prefix + message, LogLevel.Info);
+ }
+
+ public void Info(string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = CultureInfo.InvariantCulture; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Info);
+ }
+
+ public void Info<TArgument>(IFormatProvider formatProvider, string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument), LogLevel.Info);
+ }
+
+ public void Info<TArgument>(string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument), LogLevel.Info);
+ }
+
+ public void Info<TArgument1, TArgument2>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Info);
+ }
+
+ public void Info<TArgument1, TArgument2>(string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Info);
+ }
+
+ public void Info<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Info);
+ }
+
+ public void Info<TArgument1, TArgument2, TArgument3>(string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Info);
+ }
+
+ public void Warn<T>(T value)
+ {
+ _inner.Write(prefix + value, LogLevel.Warn);
+ }
+
+ public void Warn<T>(IFormatProvider formatProvider, T value)
+ {
+ _inner.Write(String.Format(formatProvider, "{0}{1}", prefix, value), LogLevel.Warn);
+ }
+
+ public void WarnException(string message, Exception exception)
+ {
+ _inner.Write(String.Format("{0}{1}: {2}", prefix, message, exception), LogLevel.Warn);
+ }
+
+ public void Warn(IFormatProvider formatProvider, string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = formatProvider; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Warn);
+ }
+
+ public void Warn(string message)
+ {
+ _inner.Write(prefix + message, LogLevel.Warn);
+ }
+
+ public void Warn(string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = CultureInfo.InvariantCulture; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Warn);
+ }
+
+ public void Warn<TArgument>(IFormatProvider formatProvider, string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument), LogLevel.Warn);
+ }
+
+ public void Warn<TArgument>(string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument), LogLevel.Warn);
+ }
+
+ public void Warn<TArgument1, TArgument2>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Warn);
+ }
+
+ public void Warn<TArgument1, TArgument2>(string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Warn);
+ }
+
+ public void Warn<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Warn);
+ }
+
+ public void Warn<TArgument1, TArgument2, TArgument3>(string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Warn);
+ }
+
+
+ public void Error<T>(T value)
+ {
+ _inner.Write(prefix + value, LogLevel.Error);
+ }
+
+ public void Error<T>(IFormatProvider formatProvider, T value)
+ {
+ _inner.Write(String.Format(formatProvider, "{0}{1}", prefix, value), LogLevel.Error);
+ }
+
+ public void ErrorException(string message, Exception exception)
+ {
+ _inner.Write(String.Format("{0}{1}: {2}", prefix, message, exception), LogLevel.Error);
+ }
+
+ public void Error(IFormatProvider formatProvider, string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = formatProvider; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Error);
+ }
+
+ public void Error(string message)
+ {
+ _inner.Write(prefix + message, LogLevel.Error);
+ }
+
+ public void Error(string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = CultureInfo.InvariantCulture; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Error);
+ }
+
+ public void Error<TArgument>(IFormatProvider formatProvider, string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument), LogLevel.Error);
+ }
+
+ public void Error<TArgument>(string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument), LogLevel.Error);
+ }
+
+ public void Error<TArgument1, TArgument2>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Error);
+ }
+
+ public void Error<TArgument1, TArgument2>(string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Error);
+ }
+
+ public void Error<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Error);
+ }
+
+ public void Error<TArgument1, TArgument2, TArgument3>(string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Error);
+ }
+
+
+ public void Fatal<T>(T value)
+ {
+ _inner.Write(prefix + value, LogLevel.Fatal);
+ }
+
+ public void Fatal<T>(IFormatProvider formatProvider, T value)
+ {
+ _inner.Write(String.Format(formatProvider, "{0}{1}", prefix, value), LogLevel.Fatal);
+ }
+
+ public void FatalException(string message, Exception exception)
+ {
+ _inner.Write(String.Format("{0}{1}: {2}", prefix, message, exception), LogLevel.Fatal);
+ }
+
+ public void Fatal(IFormatProvider formatProvider, string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = formatProvider; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Fatal);
+ }
+
+ public void Fatal(string message)
+ {
+ _inner.Write(prefix + message, LogLevel.Fatal);
+ }
+
+ public void Fatal(string message, params object[] args)
+ {
+ var sfArgs = new object[args.Length + 2];
+ sfArgs[0] = CultureInfo.InvariantCulture; sfArgs[1] = message;
+ Array.Copy(args, 0, sfArgs, 2, args.Length);
+ string result = (string)stringFormat.Invoke(null, sfArgs);
+
+ _inner.Write(prefix + result, LogLevel.Fatal);
+ }
+
+ public void Fatal<TArgument>(IFormatProvider formatProvider, string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument), LogLevel.Fatal);
+ }
+
+ public void Fatal<TArgument>(string message, TArgument argument)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument), LogLevel.Fatal);
+ }
+
+ public void Fatal<TArgument1, TArgument2>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Fatal);
+ }
+
+ public void Fatal<TArgument1, TArgument2>(string message, TArgument1 argument1, TArgument2 argument2)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Fatal);
+ }
+
+ public void Fatal<TArgument1, TArgument2, TArgument3>(IFormatProvider formatProvider, string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(formatProvider, message, argument1, argument2), LogLevel.Fatal);
+ }
+
+ public void Fatal<TArgument1, TArgument2, TArgument3>(string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3)
+ {
+ _inner.Write(prefix + String.Format(CultureInfo.InvariantCulture, message, argument1, argument2), LogLevel.Fatal);
+ }
+
+ public void Write([Localizable(false)] string message, LogLevel logLevel)
+ {
+ _inner.Write(message, logLevel);
+ }
+
+ public LogLevel Level {
+ get { return _inner.Level; }
+ set { _inner.Level = value; }
+ }
+ }
+ #endregion
}
-// vim: tw=120 ts=4 sw=4 et :
+// vim: tw=120 ts=4 sw=4 et :
View
1 ReactiveUI/MakeObjectReactiveHelper.cs
@@ -4,7 +4,6 @@
using System.Reactive.Linq;
using System.Threading;
using System.Reactive.Subjects;
-using NLog;
namespace ReactiveUI
{
View
1 ReactiveUI/MessageBus.cs
@@ -3,7 +3,6 @@
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
-using NLog;
namespace ReactiveUI
{
View
1 ReactiveUI/ObservableAsPropertyHelper.cs
@@ -6,7 +6,6 @@
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
-using NLog;
namespace ReactiveUI
{
View
1 ReactiveUI/ObservableAsyncMRUCache.cs
@@ -5,7 +5,6 @@
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading;
-using NLog;
namespace ReactiveUI
{
View
1 ReactiveUI/ReactiveCollection.cs
@@ -13,7 +13,6 @@
using System.Diagnostics.Contracts;
using System.Threading;
using System.Reactive.Disposables;
-using NLog;
using System.Globalization;
namespace ReactiveUI
View
1 ReactiveUI/ReactiveObject.cs
@@ -11,7 +11,6 @@
using System.Runtime.Serialization;
using System.Threading;
using System.Reactive.Concurrency;
-using NLog;
#if DOTNETISOLDANDSAD || WINDOWS_PHONE
using System.Concurrency;
View
4 ReactiveUI/ReactiveUI.csproj
@@ -92,9 +92,6 @@
<NoWarn>1591, 1573, 1711, 1587, 1570, 1572</NoWarn>
</PropertyGroup>
<ItemGroup>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
@@ -153,7 +150,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
- <None Include="packages.config" />
<None Include="VariadicTemplates.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>VariadicTemplates.cs</LastGenOutput>
View
3 ReactiveUI/ReactiveUI_Mono.csproj
@@ -89,9 +89,6 @@
<DocumentationFile>bin\Release\Mono\ReactiveUI.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
View
3 ReactiveUI/ReactiveUI_SL5.csproj
@@ -56,9 +56,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
- <Reference Include="NLog">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.ComponentModel.DataAnnotations, Version=5.0.5.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217, processorArchitecture=MSIL" />
View
3 ReactiveUI/ReactiveUI_WP7.csproj
@@ -70,9 +70,6 @@
<HintPath>..\ext\WP71\AsyncCtpLibrary_Phone.dll</HintPath>
</Reference>
<Reference Include="mscorlib.Extensions" />
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\packages\NLog.2.0.0.2000\lib\sl4-windowsphone71\NLog.dll</HintPath>
- </Reference>
<Reference Include="System.Observable" />
<Reference Include="System.Reactive.Core, Version=2.0.20814.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
View
1 ReactiveUI/ReactiveUI_WinRT.csproj
@@ -116,7 +116,6 @@
<Compile Include="MakeObjectReactiveHelper.cs" />
<Compile Include="MemoizingMRUCache.cs" />
<Compile Include="MessageBus.cs" />
- <Compile Include="NLogStub.cs" />
<Compile Include="ObservableAsPropertyHelper.cs" />
<Compile Include="ObservableAsyncMRUCache.cs" />
<Compile Include="ObservedChangedMixin.cs" />
View
14 ReactiveUI/RxApp.cs
@@ -6,8 +6,10 @@
using System.Diagnostics.Contracts;
using System.Linq;
using System.Linq.Expressions;
+using System.Reactive.Subjects;
using System.Reflection;
-using NLog;
+using System.Threading;
+
using System.Threading.Tasks;
using System.Reactive.Threading.Tasks;
@@ -58,6 +60,8 @@ static RxApp()
MessageBus = new MessageBus();
+ LoggerFactory = t => new DebugLogger();
+
RxApp.Register(typeof(INPCObservableForProperty), typeof(ICreatesObservableForProperty));
RxApp.Register(typeof(IRNPCObservableForProperty), typeof(ICreatesObservableForProperty));
RxApp.Register(typeof(POCOObservableForProperty), typeof(ICreatesObservableForProperty));
@@ -141,7 +145,13 @@ static RxApp()
/// string parameter is the 'prefix' (usually the class name of the log
/// entry)
/// </summary>
- //public static Func<string, ILog> LoggerFactory { get; set; }
+
+ static Func<Type, IRxUILogger> _LoggerFactory;
+ static internal readonly Subject<Unit> _LoggerFactoryChanged = new Subject<Unit>();
+ public static Func<Type, IRxUILogger> LoggerFactory {
+ get { return _LoggerFactory; }
+ set { _LoggerFactory = value; _LoggerFactoryChanged.OnNext(Unit.Default); }
+ }
[ThreadStatic] static IMessageBus _UnitTestMessageBus;
static IMessageBus _MessageBus;
View
1 ReactiveUI/Validation.cs
@@ -7,7 +7,6 @@
using System.Reactive.Subjects;
using System.Reflection;
using System.Runtime.Serialization;
-using NLog;
namespace ReactiveUI
{
View
4 ReactiveUI/packages.config
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="NLog" version="2.0.0.2000" />
-</packages>
View
2 packages/repositories.config
@@ -2,7 +2,6 @@
<repositories>
<repository path="..\PerfConsoleRunner\packages.config" />
<repository path="..\ReactiveUI.Blend\packages.config" />
- <repository path="..\ReactiveUI.Routing.Tests\packages.config" />
<repository path="..\ReactiveUI.Routing\packages.config" />
<repository path="..\ReactiveUI.Sample\ReactiveUI.Sample.Tests\packages.config" />
<repository path="..\ReactiveUI.Sample\ReactiveUI.Sample\packages.config" />
@@ -12,5 +11,4 @@
<repository path="..\ReactiveUI.Testing\packages.config" />
<repository path="..\ReactiveUI.Tests\packages.config" />
<repository path="..\ReactiveUI.Xaml\packages.config" />
- <repository path="..\ReactiveUI\packages.config" />
</repositories>

0 comments on commit 2ae9e78

Please sign in to comment.
Something went wrong with that request. Please try again.