Skip to content

Commit 1067119

Browse files
Update README, enable logging (#15)
* Update README, enable logging * Update status badge
1 parent 46dddf5 commit 1067119

6 files changed

Lines changed: 176 additions & 53 deletions

File tree

README.md

Lines changed: 170 additions & 49 deletions
Large diffs are not rendered by default.

Sources/ApodiniMigrator/LibraryStructure/Components/Directory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class Directory: LibraryComposite {
3838
public func handle(at path: Path, with context: MigrationContext) throws {
3939
let directoryPath = path + self.path.description(with: context)
4040

41-
context.logger.debug("Creating directory \(self.path.description(with: context)) at: \(path.absolute())")
41+
context.logger.info("Creating directory \(self.path.description(with: context)) at: \(path.abbreviate())")
4242
try directoryPath.mkpath()
4343
}
4444
}

Sources/ApodiniMigrator/LibraryStructure/Components/GeneratedFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public extension GeneratedFile {
3232
/// Default implementation to write the generated file and handle ``Placeholder`` replacements.
3333
func handle(at path: Path, with context: MigrationContext) throws {
3434
precondition(!fileName.isEmpty)
35-
context.logger.debug("Rendering file \(fileName.description(with: context)) at: \(path.absolute())")
35+
context.logger.info("Rendering file \(fileName.description(with: context)) at: \(path.abbreviate())")
3636
let filePath = path + fileName.description(with: context)
3737
try filePath.write(formattedFile(with: context), encoding: .utf8)
3838
}

Sources/ApodiniMigrator/LibraryStructure/Components/ResourceFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class ResourceFile: LibraryNode {
8080
fileContent += "\n" + fileSuffix
8181
}
8282

83-
context.logger.debug("Copying resource file \(rawSrcFileName)\(rawSrcFileName != rawDstFileName ? "to \(rawDstFileName)": "") at: \(path.absolute())")
83+
context.logger.info("Copying resource file \(rawSrcFileName)\(rawSrcFileName != rawDstFileName ? "to \(rawDstFileName)": "") at: \(path.abbreviate())")
8484

8585
let destinationPath = path + rawDstFileName
8686
try destinationPath.write(fileContent, encoding: .utf8)

Sources/ApodiniMigrator/LibraryStructure/Components/Root/RootDirectory.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public class RootDirectory: LibraryComposite {
5959
let rootPath = path + packageName
6060
try? rootPath.delete()
6161
try rootPath.mkpath()
62+
63+
context.logger.info("Starting library generation at: \(path.abbreviate())")
6264

6365
packageSwift.targets.append(contentsOf: sources.targets.map { $0.targetDescription(with: context) })
6466
packageSwift.targets.append(contentsOf: tests?.targets.map { $0.targetDescription(with: context) } ?? [])

Sources/ApodiniMigrator/LibraryStructure/LibraryComposite.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public extension LibraryComposite {
3737

3838
/// Default implementation for handle, which does nothing.
3939
func handle(at path: Path, with context: MigrationContext) throws {
40-
context.logger.debug("Handling library composite \(Self.self) at: \(path.absolute())")
40+
context.logger.info("Handling library composite \(Self.self) at: \(path.abbreviate())")
4141
}
4242
}
4343

0 commit comments

Comments
 (0)