MCPcopy Create free account
hub / github.com/ScrapeGraphAI/just-scrape / create

Function create

src/lib/log.ts:17–41  ·  view source on GitHub ↗
(quiet = false)

Source from the content-addressed store, hash-verified

15}
16
17export function create(quiet = false) {
18 const s = p.spinner();
19 return {
20 docs(url: string) {
21 if (!quiet) console.log(chalk.dim(`Docs: ${url}`));
22 },
23 start(msg: string) {
24 if (!quiet) s.start(msg);
25 },
26 stop(ms: number) {
27 if (!quiet) s.stop(`Done in ${elapsed(ms)}`);
28 },
29 poll(status: string) {
30 if (!quiet) s.message(`Status: ${status}`);
31 },
32 result(data: unknown) {
33 if (quiet) console.log(JSON.stringify(data));
34 else console.log(`\n${highlight(JSON.stringify(data, null, 2))}\n`);
35 },
36 error(message?: string): never {
37 p.log.error(message ?? "Unknown error");
38 process.exit(1);
39 },
40 };
41}
42
43export type Logger = ReturnType<typeof create>;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected