File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/SolutionTemplate/UnoSolutionTemplate.net6/Shared Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,15 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
116
116
/// </summary>
117
117
private static void InitializeLogging ( )
118
118
{
119
- var factory = LoggerFactory . Create ( builder =>
119
+ #if DEBUG
120
+ // Logging is disabled by default for release builds, as it incurs a significant
121
+ // initialization cost from Microsoft.Extensions.Logging setup. If startup performance
122
+ // is a concern for your application, keep this disabled. If you're running on web or
123
+ // desktop targets, you can use url or command line parameters to enable it.
124
+ //
125
+ // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html
126
+
127
+ var factory = LoggerFactory . Create ( builder =>
120
128
{
121
129
#if __WASM__
122
130
builder . AddProvider ( new global ::Uno . Extensions . Logging . WebAssembly . WebAssemblyConsoleLoggerProvider ( ) ) ;
@@ -169,6 +177,7 @@ private static void InitializeLogging()
169
177
#if HAS_UNO
170
178
global ::Uno . UI . Adapter . Microsoft . Extensions . Logging . LoggingAdapter . Initialize ( ) ;
171
179
#endif
172
- }
173
- }
180
+ #endif
181
+ }
182
+ }
174
183
}
You can’t perform that action at this time.
0 commit comments