techdocs-backend: remove duplicate log tagging
This commit is contained in:
@@ -66,22 +66,16 @@ export class DocsBuilder {
|
||||
}
|
||||
|
||||
public async build() {
|
||||
this.logger.info(
|
||||
`[TechDocs] Running preparer on entity ${getEntityId(this.entity)}`,
|
||||
);
|
||||
this.logger.info(`Running preparer on entity ${getEntityId(this.entity)}`);
|
||||
const preparedDir = await this.preparer.prepare(this.entity);
|
||||
|
||||
this.logger.info(
|
||||
`[TechDocs] Running generator on entity ${getEntityId(this.entity)}`,
|
||||
);
|
||||
this.logger.info(`Running generator on entity ${getEntityId(this.entity)}`);
|
||||
const { resultDir } = await this.generator.run({
|
||||
directory: preparedDir,
|
||||
dockerClient: this.dockerClient,
|
||||
});
|
||||
|
||||
this.logger.info(
|
||||
`[TechDocs] Running publisher on entity ${getEntityId(this.entity)}`,
|
||||
);
|
||||
this.logger.info(`Running publisher on entity ${getEntityId(this.entity)}`);
|
||||
await this.publisher.publish({
|
||||
entity: this.entity,
|
||||
directory: resultDir,
|
||||
@@ -117,16 +111,14 @@ export class DocsBuilder {
|
||||
// Check if documentation source is newer than what we have
|
||||
if (storageTimeStamp && storageTimeStamp >= lastCommit) {
|
||||
this.logger.debug(
|
||||
`[TechDocs] Docs for entity ${getEntityId(
|
||||
this.entity,
|
||||
)} is up to date.`,
|
||||
`Docs for entity ${getEntityId(this.entity)} is up to date.`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.debug(
|
||||
`[TechDocs] Docs for entity ${getEntityId(this.entity)} was outdated.`,
|
||||
`Docs for entity ${getEntityId(this.entity)} was outdated.`,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -71,9 +71,7 @@ export async function createRouter({
|
||||
const mkDocsMetadata = await (await fetch(metadataURL)).json();
|
||||
res.send(mkDocsMetadata);
|
||||
} catch (err) {
|
||||
logger.info(
|
||||
`[TechDocs] Unable to get metadata for ${path} with error ${err}`,
|
||||
);
|
||||
logger.info(`Unable to get metadata for ${path} with error ${err}`);
|
||||
throw new Error(`Unable to get metadata for ${path} with error ${err}`);
|
||||
}
|
||||
});
|
||||
@@ -93,7 +91,7 @@ export async function createRouter({
|
||||
res.send({ ...entity, locationMetadata });
|
||||
} catch (err) {
|
||||
logger.info(
|
||||
`[TechDocs] Unable to get metadata for ${kind}/${namespace}/${name} with error ${err}`,
|
||||
`Unable to get metadata for ${kind}/${namespace}/${name} with error ${err}`,
|
||||
);
|
||||
throw new Error(
|
||||
`Unable to get metadata for ${kind}/${namespace}/${name} with error ${err}`,
|
||||
|
||||
@@ -83,7 +83,7 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
logStream,
|
||||
});
|
||||
this.logger.info(
|
||||
`[TechDocs]: Successfully generated docs from ${directory} into ${resultDir} using local mkdocs`,
|
||||
`Successfully generated docs from ${directory} into ${resultDir} using local mkdocs`,
|
||||
);
|
||||
break;
|
||||
case 'docker':
|
||||
@@ -96,7 +96,7 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
dockerClient,
|
||||
});
|
||||
this.logger.info(
|
||||
`[TechDocs]: Successfully generated docs from ${directory} into ${resultDir} using techdocs-container`,
|
||||
`Successfully generated docs from ${directory} into ${resultDir} using techdocs-container`,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -106,9 +106,9 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.debug(
|
||||
`[TechDocs]: Failed to generate docs from ${directory} into ${resultDir}`,
|
||||
`Failed to generate docs from ${directory} into ${resultDir}`,
|
||||
);
|
||||
this.logger.debug(`[TechDocs]: Build failed with error: ${log}`);
|
||||
this.logger.debug(`Build failed with error: ${log}`);
|
||||
throw new Error(
|
||||
`Failed to generate docs from ${directory} into ${resultDir} with error ${error.message}`,
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@ export class DirectoryPreparer implements PreparerBase {
|
||||
);
|
||||
|
||||
this.logger.debug(
|
||||
`[TechDocs] Building docs for entity with type 'dir' and managed-by-location '${type}'`,
|
||||
`Building docs for entity with type 'dir' and managed-by-location '${type}'`,
|
||||
);
|
||||
switch (type) {
|
||||
case 'github':
|
||||
|
||||
Reference in New Issue
Block a user