From 6161d5e77c085ff2e7a06f7999a812c271d3e679 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:26:08 +0200 Subject: [PATCH] Feature/improve logger output of info service (#2331) * Improve context of logger output * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/info/info.service.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b96fb62f4..c48622011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the logger output of the info service - Harmonized the logger output: () - Improved the language localization for Italian (`it`) - Improved the language localization for Dutch (`nl`) diff --git a/apps/api/src/app/info/info.service.ts b/apps/api/src/app/info/info.service.ts index ec294bc25..3ac1cfbc1 100644 --- a/apps/api/src/app/info/info.service.ts +++ b/apps/api/src/app/info/info.service.ts @@ -177,7 +177,7 @@ export class InfoService { return pull_count; } catch (error) { - Logger.error(error, 'InfoService'); + Logger.error(error, 'InfoService - DockerHub'); return undefined; } @@ -195,7 +195,7 @@ export class InfoService { ).text() ); } catch (error) { - Logger.error(error, 'InfoService'); + Logger.error(error, 'InfoService - GitHub'); return undefined; } @@ -212,7 +212,7 @@ export class InfoService { return stargazers_count; } catch (error) { - Logger.error(error, 'InfoService'); + Logger.error(error, 'InfoService - GitHub'); return undefined; } @@ -324,7 +324,7 @@ export class InfoService { )) as string; const { data } = await got( - `https://betteruptime.com/api/v2/monitors/${monitorId}/sla?from=${format( + `https://uptime.betterstack.com/api/v2/monitors/${monitorId}/sla?from=${format( subDays(new Date(), 90), DATE_FORMAT )}&to${format(new Date(), DATE_FORMAT)}`, @@ -340,7 +340,7 @@ export class InfoService { return data.attributes.availability / 100; } catch (error) { - Logger.error(error, 'InfoService'); + Logger.error(error, 'InfoService - Better Stack'); return undefined; }