diff options
| author | Pridon Tetradze <[email protected]> | 2022-12-10 12:07:19 +0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-10 12:07:19 +0400 |
| commit | cb43f40f8f3c9e495f025359eed6e24a6542f47f (patch) | |
| tree | 99ac12a50e997a78309d08b676b1a3d55e5d3096 /src/util | |
| parent | c7e06f35d9f4b6ac685d59de0ea7d062f520d0e0 (diff) | |
| download | countryfetch-cb43f40f8f3c9e495f025359eed6e24a6542f47f.tar.xz countryfetch-cb43f40f8f3c9e495f025359eed6e24a6542f47f.zip | |
add progress logger (#11)
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/logger.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/logger.ts b/src/util/logger.ts index 4df9fb7..49dcd86 100644 --- a/src/util/logger.ts +++ b/src/util/logger.ts @@ -18,6 +18,18 @@ export class Logger { console.error(nano.red(data)); } + public progress( + current: number, + total: number, + config?: { title: string; description: string } + ) { + console.clear(); + if (config?.title) { + this.alert(config.title); + } + console.log(`${current}/${total} ${config?.description || ""}`); + } + public logCountry(country: FetchedCountry) { console.log( nano.cyan("Country:"), |
