Skip to content

Commit

Permalink
Merge pull request #12 from projectsyn/feat/better-log-messages
Browse files Browse the repository at this point in the history
Clean up log messages related to Lieutenant API
  • Loading branch information
simu authored Jan 14, 2022
2 parents 44c5313 + 3a1a592 commit ef529ac
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/commodore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,39 @@ export async function extractPackageFile(
if (config.lieutenantURL && config.lieutenantURL != '') {
if (config.lieutenantToken == '') {
logger.warn(
`Lieutenant token is empty. Renovate won't try to query the Lieutenant API at ${config.lieutenantURL}`
{
cluster: cluster.name,
lieutenantURL: config.lieutenantURL,
},
"Lieutenant token is empty. Renovate won't try to query the Lieutenant API"
);
} else {
logger.info(`Querying Lieutenant at ${config.lieutenantURL}`);
logger.debug(
{
lieutenantURL: config.lieutenantURL,
},
'Querying Lieutenant'
);
try {
clusterInfo = await fetchClusterInfo(config, cluster.name);
} catch (error: any) {
if (error instanceof LieutenantError) {
const err = error as LieutenantError;
if (err.statusCode == 404) {
logger.debug(`Lieutenant query returned 404 for ${cluster.name}`);
logger.debug(
{
cluster: cluster.name,
},
'Lieutenant query returned 404'
);
} else {
logger.info(
`Error querying Lieutenant for ${cluster.name}: statusCode=${err.statusCode}, reason=${err.message}`
{
cluster: cluster.name,
statusCode: err.statusCode,
reason: err.message,
},
'Error querying Lieutenant'
);
}
} else {
Expand Down

0 comments on commit ef529ac

Please sign in to comment.