public void ModifyShamanOptions(ShamanOptions options) { var callerInfo = ShamanCallstackSpy.CallerInfo; if (callerInfo != CallerInfoType.AddMigration && callerInfo != CallerInfoType.RemoveMigration) { return; } var consoleLogger = new MethodCallLogger(LogInfoToConsole); var message = callerInfo == CallerInfoType.AddMigration ? "Running under add-migration" : "Running under remove-migration"; consoleLogger.Log(typeof(LogToConsoleWhileMigrationService), nameof(ModifyShamanOptions), message); options.WithLogger(options.Logger.Append(consoleLogger)); }
public void ModifyShamanOptions([NotNull] ShamanOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } var callerInfo = ShamanCallstackSpy.GetCallerInfo(options.Logger); if (callerInfo != CallerInfoType.AddMigration && callerInfo != CallerInfoType.RemoveMigration) { return; } var consoleLogger = new MethodCallLogger(LogInfoToConsole, LogExceptionToConsole); var message = callerInfo == CallerInfoType.AddMigration ? "Running under add-migration" : "Running under remove-migration"; consoleLogger.Log(typeof(LogToConsoleWhileMigrationService), nameof(ModifyShamanOptions), message); options.WithLogger(options.Logger.Append(consoleLogger)); }