Skip to content

Commit

Permalink
remove ILoggerFacade
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Aug 22, 2020
1 parent 463d18a commit 86510aa
Show file tree
Hide file tree
Showing 50 changed files with 129 additions and 878 deletions.
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

0 comments on commit 86510aa

Please sign in to comment.