You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DebugLogger class uses Debug.WriteLine and since nuget-packages for Prism is compiled in release mode this class will not work even if it is used in an application that is compiled in debug mode.
In addition the string handling is still there without doing anything which means unnecessary CPU cycles is spent on mobile devices. It does not appear that the linker manages to optimize the code and remove the string handling.
Package info
Platform: Xamarin
Prism version: 6.3.0
Repro steps
Create a new Xamarin Prism Application.
Configure the Prism Application to use the DebugLogger by overriding CreateLogger.
Expected: Additional debug information should be visible in the Visual Studio debug output during debugging.
Actually: Nothing is logged.
Suggested solution
Since the DebugLogger class never can work when compiled in Release-mode, add conditional compilation to prevent it from being used when Prism is consumed as a nuget-package.
Also change the default logger to EmptyLogger when Prism is not compiled in debug mode.
I think your solution makes sense. I mainly leave the Debug logger there for when I am developing features. It makes sense that when it is in release mode, that an empty logger should be provided, and the developer must provide their own logger if they wish. Submit your PR.
The DebugLogger class uses Debug.WriteLine and since nuget-packages for Prism is compiled in release mode this class will not work even if it is used in an application that is compiled in debug mode.
In addition the string handling is still there without doing anything which means unnecessary CPU cycles is spent on mobile devices. It does not appear that the linker manages to optimize the code and remove the string handling.
Package info
Repro steps
Expected: Additional debug information should be visible in the Visual Studio debug output during debugging.
Actually: Nothing is logged.
Suggested solution
Since the DebugLogger class never can work when compiled in Release-mode, add conditional compilation to prevent it from being used when Prism is consumed as a nuget-package.
Also change the default logger to EmptyLogger when Prism is not compiled in debug mode.
My suggestion how to improve Prism
The text was updated successfully, but these errors were encountered: