WIP: pretty logging

This commit is contained in:
John Rommel Estropia
2016-05-06 09:19:24 +08:00
parent 0073d038e0
commit 4eecd80710
6 changed files with 495 additions and 145 deletions

View File

@@ -248,31 +248,3 @@ public struct MigrationChain: NilLiteralConvertible, StringLiteralConvertible, D
private let versionTree: [String: String]
}
// MARK: - MigrationChain: CustomDebugStringConvertible
extension MigrationChain: CustomDebugStringConvertible {
public var debugDescription: String {
guard self.valid else {
return "<invalid migration chain>"
}
var paths = [String]()
for var version in self.rootVersions {
var steps = [version]
while let nextVersion = self.nextVersionFrom(version) {
steps.append(nextVersion)
version = nextVersion
}
paths.append(steps.joinWithSeparator(""))
}
return "[" + paths.joinWithSeparator("], [") + "]"
}
}