示例#1
0
        public static UpgradeEngineBuilder LogToLogger <T>([NotNull] this UpgradeEngineBuilder builder, [NotNull] ILogger <T> logger)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            builder.LogTo(new DbUpLogger <T>(logger));

            return(builder);
        }
 /// <summary>
 /// Logs to SqlContext.Pipe, for use with "context connection=true".
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <returns>
 /// The same builder
 /// </returns>
 public static UpgradeEngineBuilder LogToSqlContext(this UpgradeEngineBuilder builder)
 {
     return(builder.LogTo(new SqlContextUpgradeLog()));
 }
 /// <summary>
 /// Override the LogsTo to inject an any logger based on <see cref="ILogger"/>.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="logger">The logger to be used.</param>
 /// <returns>The builder itself.</returns>
 public static UpgradeEngineBuilder LogTo(this UpgradeEngineBuilder builder, ILogger logger)
 {
     builder.LogTo(new LoggerWrapper(logger));
     return(builder);
 }