From 42bd92aee4bbfdd246be14af52c9a2a4020987dc Mon Sep 17 00:00:00 2001 From: Bridget Barnes Date: Fri, 8 Apr 2022 14:24:17 +1000 Subject: [PATCH] try injection Signed-off-by: Bridget Barnes --- plugins/techdocs-backend/src/service/DocsSynchronizer.ts | 5 ++++- plugins/techdocs-backend/src/service/router.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/techdocs-backend/src/service/DocsSynchronizer.ts b/plugins/techdocs-backend/src/service/DocsSynchronizer.ts index 03ee557f80..87c174f8ac 100644 --- a/plugins/techdocs-backend/src/service/DocsSynchronizer.ts +++ b/plugins/techdocs-backend/src/service/DocsSynchronizer.ts @@ -43,6 +43,7 @@ export type DocsSynchronizerSyncOpts = { export class DocsSynchronizer { private readonly publisher: PublisherBase; private readonly logger: winston.Logger; + private readonly buildLogger: winston.Logger; private readonly config: Config; private readonly scmIntegrations: ScmIntegrationRegistry; private readonly cache: TechDocsCache | undefined; @@ -50,6 +51,7 @@ export class DocsSynchronizer { constructor({ publisher, logger, + buildLogger, config, scmIntegrations, cache, @@ -62,6 +64,7 @@ export class DocsSynchronizer { }) { this.config = config; this.logger = logger; + this.buildLogger = buildLogger; this.publisher = publisher; this.scmIntegrations = scmIntegrations; this.cache = cache; @@ -96,7 +99,7 @@ export class DocsSynchronizer { }); taskLogger.add(new winston.transports.Stream({ stream: logStream })); - taskLogger.add(this.logger); + taskLogger.add(this.buildLogger); // check if the last update check was too recent if (!shouldCheckForUpdate(entity.metadata.uid!)) { diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index 148143e460..e37f01909a 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -56,6 +56,7 @@ export type OutOfTheBoxDeploymentOptions = { config: Config; cache: PluginCacheManager; docsBuildStrategy?: DocsBuildStrategy; + buildLogger: Logger; }; /** @@ -127,6 +128,7 @@ export async function createRouter( const docsSynchronizer = new DocsSynchronizer({ publisher, logger, + buildLogger, config, scmIntegrations, cache,