44 type ExcludeNullableProps ,
55 asyncSequential ,
66 hasNoNullableProps ,
7- logger ,
87} from '@code-pushup/utils' ;
98import {
109 type CommandContext ,
@@ -16,6 +15,7 @@ import {
1615 runMergeDiffs ,
1716} from './cli/index.js' ;
1817import { commentOnPR } from './comment.js' ;
18+ import { logDebug , logInfo } from './log.js' ;
1919import type {
2020 GitBranch ,
2121 MonorepoRunResult ,
@@ -52,7 +52,7 @@ export async function runInMonorepoMode(
5252) : Promise < MonorepoRunResult > {
5353 const { api, settings } = env ;
5454
55- logger . info ( 'Running Code PushUp in monorepo mode' ) ;
55+ logInfo ( 'Running Code PushUp in monorepo mode' ) ;
5656
5757 const { projects, runManyCommand } = await listMonorepoProjects ( settings ) ;
5858 const projectResults = runManyCommand
@@ -71,7 +71,7 @@ export async function runInMonorepoMode(
7171 diffJsonPaths ,
7272 createCommandContext ( settings , projects [ 0 ] ) ,
7373 ) ;
74- logger . debug ( `Merged ${ diffJsonPaths . length } diffs into ${ tmpDiffPath } ` ) ;
74+ logDebug ( `Merged ${ diffJsonPaths . length } diffs into ${ tmpDiffPath } ` ) ;
7575 const { md : diffPath } = await saveOutputFiles ( {
7676 project : null ,
7777 type : 'comparison' ,
@@ -105,7 +105,7 @@ function runProjectsIndividually(
105105 projects : ProjectConfig [ ] ,
106106 env : RunEnv ,
107107) : Promise < ProjectRunResult [ ] > {
108- logger . info ( `Running on ${ projects . length } projects individually` ) ;
108+ logInfo ( `Running on ${ projects . length } projects individually` ) ;
109109 return asyncSequential ( projects , project => runOnProject ( project , env ) ) ;
110110}
111111
@@ -119,7 +119,7 @@ async function runProjectsInBulk(
119119 settings,
120120 } = env ;
121121
122- logger . info (
122+ logInfo (
123123 `Running on ${ projects . length } projects in bulk (parallel: ${ settings . parallel } )` ,
124124 ) ;
125125
@@ -173,7 +173,7 @@ async function loadProjectEnvs(
173173
174174 const hasFormats = allProjectsHaveDefaultPersistFormats ( projectEnvs ) ;
175175
176- logger . debug (
176+ logDebug (
177177 [
178178 configPatterns
179179 ? `Parsed ${ projectEnvs . length } persist and upload configs by interpolating configPatterns option for each project.`
@@ -211,7 +211,7 @@ async function compareProjectsInBulk(
211211 const uncachedProjectReports = projectReportsWithCache . filter (
212212 ( { prevReport } ) => ! prevReport ,
213213 ) ;
214- logger . info (
214+ logInfo (
215215 `${ currProjectReports . length - uncachedProjectReports . length } out of ${ currProjectReports . length } projects loaded previous report from artifact cache` ,
216216 ) ;
217217
@@ -314,18 +314,18 @@ async function collectPreviousReports(
314314 . map ( ( { project } ) => project . name )
315315 . filter ( name => ! onlyProjects . includes ( name ) ) ;
316316 if ( invalidProjects . length > 0 ) {
317- logger . debug (
317+ logDebug (
318318 `Printing config failed for ${ invalidProjects . length } projects - ${ invalidProjects . join ( ', ' ) } ` ,
319319 ) ;
320- logger . info (
320+ logInfo (
321321 `Skipping ${ invalidProjects . length } projects which aren't configured in base branch ${ base . ref } ` ,
322322 ) ;
323323 }
324324
325325 if ( onlyProjects . length > 0 ) {
326326 const hasFormats =
327327 allProjectsHaveDefaultPersistFormats ( validProjectConfigs ) ;
328- logger . info (
328+ logInfo (
329329 `Collecting previous reports for ${ onlyProjects . length } projects` ,
330330 ) ;
331331 await collectMany ( runManyCommand , env , { hasFormats, onlyProjects } ) ;
@@ -377,7 +377,7 @@ async function collectMany(
377377 const countText = onlyProjects
378378 ? `${ onlyProjects . length } previous`
379379 : 'all current' ;
380- logger . debug ( `Collected ${ countText } reports using command \`${ command } \`` ) ;
380+ logDebug ( `Collected ${ countText } reports using command \`${ command } \`` ) ;
381381}
382382
383383async function compareMany (
@@ -397,7 +397,7 @@ async function compareMany(
397397
398398 await runCompare ( ctx , { hasFormats } ) ;
399399
400- logger . debug ( 'Compared all project reports' ) ;
400+ logDebug ( 'Compared all project reports' ) ;
401401}
402402
403403export function allProjectsHaveDefaultPersistFormats (
0 commit comments