update spinners

This commit is contained in:
Jacky Zhao
2023-06-04 13:37:43 -04:00
parent 9ad89997a5
commit 1406ee0f05
7 changed files with 128 additions and 102 deletions

26
quartz/log.ts Normal file
View File

@ -0,0 +1,26 @@
import { Spinner } from 'cli-spinner'
export class QuartzLogger {
verbose: boolean
spinner: Spinner | undefined
constructor(verbose: boolean) {
this.verbose = verbose
}
start(text: string) {
if (this.verbose) {
console.log(text)
} else {
this.spinner = new Spinner(`%s ${text}`)
this.spinner.setSpinnerString(18)
this.spinner.start()
}
}
success(text: string) {
if (!this.verbose) {
this.spinner!.stop(true)
}
console.log(text)
}
}