Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Remove ILoggerFacade & entire Prism.Logging namespace #2176

Merged
merged 3 commits into from
Aug 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions PrismLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Prism.Ioc.Shared", "tests\C
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Containers", "Containers", "{D62DD517-CA80-449D-A26B-9AB427379825}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Prism.Container.Wpf.Shared", "tests\Wpf\Prism.Container.Wpf.Shared\Prism.Container.Wpf.Shared.shproj", "{BD42A7D6-A84D-4D27-9C28-7F6A2EC477F1}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Containers\Prism.DryIoc.Shared\Prism.DryIoc.Shared.projitems*{02e0ecaa-b8c6-4eab-a9ab-164b1b99af35}*SharedItemsImports = 5
Expand All @@ -99,6 +101,7 @@ Global
src\Containers\Prism.Unity.Shared\Prism.Unity.Shared.projitems*{9a1c368f-30ae-4c82-be03-9168ce089b56}*SharedItemsImports = 5
src\Containers\Prism.DryIoc.Shared\Prism.DryIoc.Shared.projitems*{aad8a958-546b-4b7d-bbd1-d79e825530eb}*SharedItemsImports = 5
tests\Wpf\Prism.Container.Wpf.Shared\Prism.Container.Wpf.Shared.projitems*{ba05687e-2317-4a65-805b-c596f52f7203}*SharedItemsImports = 5
tests\Wpf\Prism.Container.Wpf.Shared\Prism.Container.Wpf.Shared.projitems*{bd42a7d6-a84d-4d27-9c28-7f6a2ec477f1}*SharedItemsImports = 13
src\Containers\Prism.Unity.Shared\Prism.Unity.Shared.projitems*{c2f58215-92f0-4501-a9f4-862c78b2b4ce}*SharedItemsImports = 5
tests\Forms\Prism.DI.Forms.Tests\Prism.DI.Forms.Tests.projitems*{c2ff8459-f2d1-4b87-a31a-82a1835f89cf}*SharedItemsImports = 5
src\Containers\Prism.Unity.Shared\Prism.Unity.Shared.projitems*{d66336a6-07e5-401a-a710-daedd6975d59}*SharedItemsImports = 13
Expand Down Expand Up @@ -416,6 +419,7 @@ Global
{704E14A4-C3A2-492D-9C4E-7D386A18B698} = {D62DD517-CA80-449D-A26B-9AB427379825}
{78932299-2281-4A59-BFB8-07DE3014F748} = {D62DD517-CA80-449D-A26B-9AB427379825}
{D62DD517-CA80-449D-A26B-9AB427379825} = {00FFDC13-7397-46F1-897E-A62A7575D28A}
{BD42A7D6-A84D-4D27-9C28-7F6A2EC477F1} = {F1F91777-01EA-43A3-A3ED-D473B382F46C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C7433AE2-B1A0-4C1A-887E-5CAA7AAF67A6}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void RegisterForRegionNavigation<TView>(this IContainerRegistry co
/// <summary>
/// Registers a <see cref="View"/> for region navigation.
/// </summary>
/// <typeparam name="TView">The Type of <see cref="View" to register</typeparam>
/// <typeparam name="TView">The Type of <see cref="View" />to register</typeparam>
/// <typeparam name="TViewModel">The ViewModel to use as the BindingContext for the View</typeparam>
/// <param name="name">The unique name to register with the View</param>
/// <param name="containerRegistry"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Prism.Regions.Behaviors
{
/// <summary>
/// Defines a behavior that forwards the <see cref="RegionManager.RegionContextProperty"/>
/// Defines a behavior that forwards the <see cref="Xaml.RegionManager.RegionContextProperty"/>
/// to the views in the region.
/// </summary>
public class BindRegionContextToVisualElementBehavior : IRegionBehavior
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Prism.Regions.Behaviors
/// <summary>
/// Subscribes to a static event from the <see cref="RegionManager"/> in order to register the target <see cref="IRegion"/>
/// in a <see cref="IRegionManager"/> when one is available on the host control by walking up the tree and finding
/// a control whose <see cref="RegionManager.RegionManagerProperty"/> property is not <see langword="null"/>.
/// a control whose <see cref="Xaml.RegionManager.RegionManagerProperty"/> property is not <see langword="null"/>.
/// </summary>
public class RegionManagerRegistrationBehavior : RegionBehavior, IHostAwareRegionBehavior
{
Expand Down
2 changes: 0 additions & 2 deletions src/Forms/Prism.Forms/PrismApplicationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Prism.Events;
using Prism.Extensions;
using Prism.Ioc;
using Prism.Logging;
using Prism.Modularity;
using Prism.Mvvm;
using Prism.Navigation;
Expand Down Expand Up @@ -182,7 +181,6 @@ protected virtual string GetNavigationSegmentNameFromType(Type pageType) =>
/// <param name="containerRegistry"></param>
protected virtual void RegisterRequiredTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterSingleton<ILoggerFacade, EmptyLogger>();
containerRegistry.RegisterSingleton<IApplicationProvider, ApplicationProvider>();
containerRegistry.RegisterSingleton<IApplicationStore, ApplicationStore>();
containerRegistry.RegisterSingleton<IEventAggregator, EventAggregator>();
Expand Down
31 changes: 0 additions & 31 deletions src/Prism.Core/Logging/Category.cs

This file was deleted.

29 changes: 0 additions & 29 deletions src/Prism.Core/Logging/DebugLogger.cs

This file was deleted.

24 changes: 0 additions & 24 deletions src/Prism.Core/Logging/EmptyLogger.cs

This file was deleted.

19 changes: 0 additions & 19 deletions src/Prism.Core/Logging/ILoggerFacade.cs

This file was deleted.

31 changes: 0 additions & 31 deletions src/Prism.Core/Logging/Priority.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Uno/Prism.Uno/PrismApplicationBase.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Prism.Common;
using Prism.Events;
using Prism.Ioc;
using Prism.Logging;
using Prism.Modularity;
using Prism.Mvvm;
using Prism.Regions;
Expand Down
44 changes: 17 additions & 27 deletions src/Wpf/Prism.DryIoc.Wpf/Legacy/DryIocBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Prism.DryIoc.Properties;
using Prism.Events;
using Prism.Ioc;
using Prism.Logging;
using Prism.Modularity;
using Prism.Mvvm;
using Prism.Regions;
Expand Down Expand Up @@ -39,25 +38,19 @@ public override void Run(bool runWithDefaultConfiguration)
{
_useDefaultConfiguration = runWithDefaultConfiguration;

Logger = CreateLogger();
if (Logger == null)
{
throw new InvalidOperationException(Resources.NullLoggerFacadeException);
}

Logger.Log(Resources.LoggerCreatedSuccessfully, Category.Debug, Priority.Low);
Log(Resources.LoggerCreatedSuccessfully);

Logger.Log(Resources.CreatingModuleCatalog, Category.Debug, Priority.Low);
Log(Resources.CreatingModuleCatalog);
ModuleCatalog = CreateModuleCatalog();
if (ModuleCatalog == null)
{
throw new InvalidOperationException(Resources.NullModuleCatalogException);
}

Logger.Log(Resources.ConfiguringModuleCatalog, Category.Debug, Priority.Low);
Log(Resources.ConfiguringModuleCatalog);
ConfigureModuleCatalog();

Logger.Log(Resources.CreatingContainer, Category.Debug, Priority.Low);
Log(Resources.CreatingContainer);
Container = CreateContainer();
if (Container == null)
{
Expand All @@ -67,42 +60,42 @@ public override void Run(bool runWithDefaultConfiguration)
ContainerLocator.SetContainerExtension(CreateContainerExtension);
ContainerExtension = ContainerLocator.Current;

Logger.Log(Resources.ConfiguringContainer, Category.Debug, Priority.Low);
Log(Resources.ConfiguringContainer);
ConfigureContainer();

Logger.Log(Resources.ConfiguringViewModelLocator, Category.Debug, Priority.Low);
Log(Resources.ConfiguringViewModelLocator);
ConfigureViewModelLocator();

Logger.Log(Resources.ConfiguringRegionAdapters, Category.Debug, Priority.Low);
Log(Resources.ConfiguringRegionAdapters);
ConfigureRegionAdapterMappings();

Logger.Log(Resources.ConfiguringDefaultRegionBehaviors, Category.Debug, Priority.Low);
Log(Resources.ConfiguringDefaultRegionBehaviors);
ConfigureDefaultRegionBehaviors();

Logger.Log(Resources.RegisteringFrameworkExceptionTypes, Category.Debug, Priority.Low);
Log(Resources.RegisteringFrameworkExceptionTypes);
RegisterFrameworkExceptionTypes();

Logger.Log(Resources.CreatingShell, Category.Debug, Priority.Low);
Log(Resources.CreatingShell);
Shell = CreateShell();
if (Shell != null)
{
Logger.Log(Resources.SettingTheRegionManager, Category.Debug, Priority.Low);
Log(Resources.SettingTheRegionManager);
RegionManager.SetRegionManager(Shell, Container.Resolve<IRegionManager>());

Logger.Log(Resources.UpdatingRegions, Category.Debug, Priority.Low);
Log(Resources.UpdatingRegions);
RegionManager.UpdateRegions();

Logger.Log(Resources.InitializingShell, Category.Debug, Priority.Low);
Log(Resources.InitializingShell);
InitializeShell();
}

if (Container.IsRegistered<IModuleManager>())
{
Logger.Log(Resources.InitializingModules, Category.Debug, Priority.Low);
Log(Resources.InitializingModules);
InitializeModules();
}

Logger.Log(Resources.BootstrapperSequenceCompleted, Category.Debug, Priority.Low);
Log(Resources.BootstrapperSequenceCompleted);
}

/// <summary>
Expand All @@ -119,7 +112,6 @@ protected override void ConfigureViewModelLocator()
/// </summary>
protected virtual void ConfigureContainer()
{
Container.UseInstance<ILoggerFacade>(Logger);
Container.UseInstance<IModuleCatalog>(ModuleCatalog);

if (_useDefaultConfiguration)
Expand Down Expand Up @@ -193,8 +185,7 @@ protected void RegisterTypeIfMissing<TFrom, TTarget>(bool registerAsSingleton =
{
if(Container!=null && Container.IsRegistered<TFrom>())
{
Logger.Log(String.Format(CultureInfo.CurrentCulture, Resources.TypeMappingAlreadyRegistered, typeof(TFrom).Name),
Category.Debug, Priority.Low);
Log(string.Format(CultureInfo.CurrentCulture, Resources.TypeMappingAlreadyRegistered, typeof(TFrom).Name));
}
else
{
Expand Down Expand Up @@ -227,8 +218,7 @@ protected void RegisterTypeIfMissing(Type fromType, Type toType, bool registerAs
}
if (Container.IsRegistered(fromType))
{
Logger.Log(String.Format(CultureInfo.CurrentCulture, Resources.TypeMappingAlreadyRegistered, fromType.Name),
Category.Debug, Priority.Low);
Log(string.Format(CultureInfo.CurrentCulture, Resources.TypeMappingAlreadyRegistered, fromType.Name));
}
else
{
Expand Down
Loading