1
0
mirror of https://gitlab.com/MisterBiggs/brain-quartz.git synced 2025-08-16 02:14:57 +00:00
Files
.github
content
docs
quartz
cli
components
i18n
plugins
processors
static
styles
util
ctx.ts
escape.ts
glob.ts
jsx.tsx
lang.ts
log.ts
path.test.ts
path.ts
perf.ts
resources.tsx
sourcemap.ts
theme.ts
trace.ts
bootstrap-cli.mjs
bootstrap-worker.mjs
build.ts
cfg.ts
depgraph.test.ts
depgraph.ts
worker.ts
.gitattributes
.gitignore
.node-version
.npmrc
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
Dockerfile
LICENSE.txt
README.md
globals.d.ts
index.d.ts
package-lock.json
package.json
quartz.config.ts
quartz.layout.ts
tsconfig.json
brain-quartz/quartz/util/log.ts

29 lines
530 B
TypeScript

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()
}
}
end(text?: string) {
if (!this.verbose) {
this.spinner!.stop(true)
}
if (text) {
console.log(text)
}
}
}