logs: improve logging

This commit is contained in:
Rhys Arkins 2021-02-24 15:18:43 +01:00
parent 566f64cea0
commit e9297944ab
3 changed files with 11 additions and 6 deletions

View file

@ -429,7 +429,7 @@ export async function getAdditionalFiles(
return { artifactErrors, updatedArtifacts }; return { artifactErrors, updatedArtifacts };
} }
const dirs = determineLockFileDirs(config, packageFiles); const dirs = determineLockFileDirs(config, packageFiles);
logger.debug({ dirs }, 'lock file dirs'); logger.trace({ dirs }, 'lock file dirs');
await writeExistingFiles(config, packageFiles); await writeExistingFiles(config, packageFiles);
await writeUpdatedPackageFiles(config); await writeUpdatedPackageFiles(config);

View file

@ -19,10 +19,9 @@ export async function getUpdatedPackageFiles(
config: BranchConfig config: BranchConfig
): Promise<PackageFilesResult> { ): Promise<PackageFilesResult> {
logger.trace({ config }); logger.trace({ config });
const { branchName, reuseExistingBranch } = config; const { reuseExistingBranch } = config;
logger.debug( logger.debug(
{ reuseExistingBranch, branchName }, `manager.getUpdatedPackageFiles() reuseExistinbranch=${reuseExistingBranch}`
'manager.getUpdatedPackageFiles()'
); );
const updatedFileContents: Record<string, string> = {}; const updatedFileContents: Record<string, string> = {};
const nonUpdatedFileContents: Record<string, string> = {}; const nonUpdatedFileContents: Record<string, string> = {};
@ -134,7 +133,7 @@ export async function getUpdatedPackageFiles(
reuseExistingBranch: false, reuseExistingBranch: false,
}); });
} }
logger.debug({ packageFile, depName }, 'Updating packageFile content'); logger.debug(`Updating ${depName} in ${packageFile}`);
updatedFileContents[packageFile] = newContent; updatedFileContents[packageFile] = newContent;
} }
if (newContent === existingContent) { if (newContent === existingContent) {

View file

@ -99,7 +99,13 @@ export async function pruneStaleBranches(
logger.debug('No renovate branches found'); logger.debug('No renovate branches found');
return; return;
} }
logger.debug({ branchList, renovateBranches }, 'Branch lists'); logger.debug(
{
branchList: branchList?.sort(),
renovateBranches: renovateBranches?.sort(),
},
'Branch lists'
);
const lockFileBranch = `${config.branchPrefix}lock-file-maintenance`; const lockFileBranch = `${config.branchPrefix}lock-file-maintenance`;
renovateBranches = renovateBranches.filter( renovateBranches = renovateBranches.filter(
(branch) => branch !== lockFileBranch (branch) => branch !== lockFileBranch