using System; using System.Collections.Generic; namespace Migrator.Framework { public interface ILogger { /// /// Log that we have started a migration /// /// Start list of versions /// Final Version void Started(List currentVersion, long finalVersion); /// /// Log that we are migrating up /// /// Version we are migrating to /// Migration name void MigrateUp(long version, string migrationName); /// /// Log that we are migrating down /// /// Version we are migrating to /// Migration name void MigrateDown(long version, string migrationName); /// /// Inform that a migration corresponding to the number of /// version is untraceable (not found?) and will be ignored. /// /// Version we couldnt find void Skipping(long version); /// /// Log that we are rolling back to version /// /// /// version /// void RollingBack(long originalVersion); /// /// Log a Sql statement that changes the schema or content of the database as part of a migration /// /// /// SELECT statements should not be logged using this method as they do not alter the data or schema of the /// database. /// /// The Sql statement to log void ApplyingDBChange(string sql); /// /// Log that we had an exception on a migration /// /// The version of the migration that caused the exception. /// The name of the migration that caused the exception. /// The exception itself void Exception(long version, string migrationName, Exception ex); /// /// Log that we had an exception on a migration /// /// An informative message to show to the user. /// The exception itself void Exception(string message, Exception ex); /// /// Log that we have finished a migration /// /// List of versions with which we started /// Final Version void Finished(List currentVersion, long finalVersion); /// /// Log a message /// /// The format string ("{0}, blabla {1}"). /// Parameters to apply to the format string. void Log(string format, params object[] args); /// /// Log a Warning /// /// The format string ("{0}, blabla {1}"). /// Parameters to apply to the format string. void Warn(string format, params object[] args); /// /// Log a Trace Message /// /// The format string ("{0}, blabla {1}"). /// Parameters to apply to the format string. void Trace(string format, params object[] args); } }