@@ -20,9 +20,9 @@ public static class SshConfigurationExtensions
2020 /// <paramref name="builder" />.
2121 /// </param>
2222 /// <returns>The <see cref="IConfigurationBuilder" />.</returns>
23- public IConfigurationBuilder AddSshConfig ( string path )
23+ public IConfigurationBuilder AddSshConfig ( string path , Action < string , Exception > ? loggingAction = null )
2424 {
25- return builder . AddSshConfig ( null , path , false , false ) ;
25+ return builder . AddSshConfig ( null , path , false , false , loggingAction ) ;
2626 }
2727
2828 /// <summary>
@@ -34,9 +34,9 @@ public IConfigurationBuilder AddSshConfig(string path)
3434 /// </param>
3535 /// <param name="optional">Whether the file is optional.</param>
3636 /// <returns>The <see cref="IConfigurationBuilder" />.</returns>
37- public IConfigurationBuilder AddSshConfig ( string path , bool optional )
37+ public IConfigurationBuilder AddSshConfig ( string path , bool optional , Action < string , Exception > ? loggingAction = null )
3838 {
39- return builder . AddSshConfig ( null , path , optional , false ) ;
39+ return builder . AddSshConfig ( null , path , optional , false , loggingAction ) ;
4040 }
4141
4242 /// <summary>
@@ -50,9 +50,9 @@ public IConfigurationBuilder AddSshConfig(string path, bool optional)
5050 /// <param name="reloadOnChange">Whether the configuration should be reloaded if the file changes.</param>
5151 /// <returns>The <see cref="IConfigurationBuilder" />.</returns>
5252 public IConfigurationBuilder AddSshConfig ( string path , bool optional ,
53- bool reloadOnChange )
53+ bool reloadOnChange , Action < string , Exception > ? loggingAction = null )
5454 {
55- return builder . AddSshConfig ( null , path , optional , reloadOnChange ) ;
55+ return builder . AddSshConfig ( null , path , optional , reloadOnChange , loggingAction ) ;
5656 }
5757
5858 /// <summary>
@@ -67,7 +67,7 @@ public IConfigurationBuilder AddSshConfig(string path, bool optional,
6767 /// <param name="reloadOnChange">Whether the configuration should be reloaded if the file changes.</param>
6868 /// <returns>The <see cref="IConfigurationBuilder" />.</returns>
6969 public IConfigurationBuilder AddSshConfig ( IFileProvider ? fileProvider ,
70- string path , bool optional , bool reloadOnChange )
70+ string path , bool optional , bool reloadOnChange , Action < string , Exception > ? loggingAction = null )
7171 {
7272 ArgumentNullException . ThrowIfNull ( builder ) ;
7373 ArgumentException . ThrowIfNullOrEmpty ( path ) ;
@@ -79,17 +79,20 @@ public IConfigurationBuilder AddSshConfig(IFileProvider? fileProvider,
7979 s . Optional = optional ;
8080 s . ReloadOnChange = reloadOnChange ;
8181 s . ResolveFileProvider ( ) ;
82- } ) ;
82+ } , loggingAction ) ;
8383 }
8484
8585 /// <summary>
8686 /// Adds an SSH configuration source to the <paramref name="builder" />.
8787 /// </summary>
8888 /// <param name="configureSource">Configures the source.</param>
8989 /// <returns>The <see cref="IConfigurationBuilder" />.</returns>
90- public IConfigurationBuilder AddSshConfig ( Action < SshConfigurationSource > ? configureSource )
90+ public IConfigurationBuilder AddSshConfig ( Action < SshConfigurationSource > ? configureSource , Action < string , Exception > ? loggingAction )
9191 {
92- var source = new SshConfigurationSource ( ) ;
92+ var source = new SshConfigurationSource
93+ {
94+ OnSkippedIncludeFile = loggingAction
95+ } ;
9396 configureSource ? . Invoke ( source ) ;
9497 return builder . Add ( source ) ;
9598 }
0 commit comments