Merge pull request #6620 from backstage/iameap/migrate-verbose-log

[TechDocs] Use verbose log-level when migrating TechDocs files
This commit is contained in:
Eric Peterson
2021-07-28 16:16:17 +02:00
committed by GitHub
5 changed files with 10 additions and 4 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/techdocs-common': patch
---
Migrated files are now printed when `techdocs-cli migrate` is run with the
`--verbose` flag set.
@@ -337,7 +337,7 @@ export class AwsS3Publish implements PublisherBase {
}
try {
this.logger.debug(`Migrating ${file}`);
this.logger.verbose(`Migrating ${file}`);
await this.storageClient
.copyObject({
Bucket: this.bucketName,
@@ -323,7 +323,7 @@ export class AzureBlobStoragePublish implements PublisherBase {
if (originalPath === newPath) return;
try {
this.logger.debug(`Migrating ${originalPath}`);
this.logger.verbose(`Migrating ${originalPath}`);
await this.renameBlob(originalPath, newPath, removeOriginal);
} catch (e) {
this.logger.warn(`Unable to migrate ${originalPath}: ${e.message}`);
@@ -196,7 +196,7 @@ export class LocalPublish implements PublisherBase {
// Otherwise, copy or move the file.
await new Promise<void>(resolve => {
const migrate = removeOriginal ? fs.move : fs.copyFile;
this.logger.debug(`Migrating ${relativeFile}`);
this.logger.verbose(`Migrating ${relativeFile}`);
migrate(file, newFile, err => {
if (err) {
this.logger.warn(
@@ -64,7 +64,7 @@ export class MigrateWriteStream extends Writable {
const migrate = this.removeOriginal
? file.move.bind(file)
: file.copy.bind(file);
this.logger.debug(`Migrating ${file.name}`);
this.logger.verbose(`Migrating ${file.name}`);
migrate(newFile)
.catch(e =>
this.logger.warn(`Unable to migrate ${file.name}: ${e.message}`),