Ejemplo n.º 1
0
 /// <summary>
 /// Logs a warning message with the data of the <see cref="FtpResponse"/>.
 /// </summary>
 /// <param name="log">The <see cref="ILogger"/> to use.</param>
 /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
 public static void Warn([NotNull] this ILogger log, [NotNull] IFtpResponse response)
 {
     if (response is FtpResponse ftpResponse)
     {
         log.LogWarning("{code} {message}", response.Code, ftpResponse.Message);
     }
     else
     {
         log.LogWarning(response.ToString());
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Logs a info message with the data of the <see cref="FtpResponse"/>.
 /// </summary>
 /// <param name="log">The <see cref="ILogger"/> to use.</param>
 /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
 public static void Info(this ILogger log, IFtpResponse response)
 {
     if (response is FtpResponse ftpResponse)
     {
         log.LogInformation("{code} {message}", response.Code, ftpResponse.Message);
     }
     else
     {
         log.LogInformation(response.ToString());
     }
 }