11using Microsoft . Extensions . DependencyInjection ;
22using Microsoft . Extensions . Hosting ;
3- using Microsoft . Extensions . Logging ;
43using Nickvision . Application . Shared . Controllers ;
54using Nickvision . Application . Shared . Services ;
65using Nickvision . Desktop . Application ;
76using Nickvision . Desktop . Filesystem ;
87using Nickvision . Desktop . Helpers ;
9- using NReco . Logging . File ;
108using System ;
119using System . IO ;
1210
@@ -27,18 +25,13 @@ public IHostApplicationBuilder ConfigureApplication(string[] args)
2725 DiscussionsForum = new Uri ( "https://github.com/NickvisionApps/Application/discussions" ) ,
2826 IsPortable = OperatingSystem . IsWindows ( ) && args . Contains ( "--portable" )
2927 } ;
30- var loggingPath = appInfo . IsPortable ? "app.log" : Path . Combine ( UserDirectories . LocalData , appInfo . Name , "app.log" ) ;
3128 builder . Properties . Add ( "AppInfo" , appInfo ) ;
3229 builder . Services . AddSingleton ( appInfo ) ;
33- builder . ConfigureNickvision ( args ) ;
30+ builder . ConfigureNickvision ( args , appInfo . IsPortable ? "app.log" : Path . Combine ( UserDirectories . LocalData , appInfo . Name , "app.log" ) ) ;
3431 builder . Services . AddSingleton < IEventsService , EventsService > ( ) ;
3532 builder . Services . AddSingleton < IFolderService , FolderService > ( ) ;
3633 builder . Services . AddSingleton < MainWindowController > ( ) ;
3734 builder . Services . AddTransient < PreferencesViewController > ( ) ;
38- builder . Logging . ClearProviders ( ) ;
39- builder . Logging . SetMinimumLevel ( LogLevel . Information ) ;
40- builder . Logging . AddConsole ( ) ;
41- builder . Logging . AddFile ( loggingPath , false ) ;
4235 return builder ;
4336 }
4437 }
0 commit comments