Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 01f7ff5

Browse files
committed
updated logging
1 parent c58db2a commit 01f7ff5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

website/src/remark/render-code-blocks.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44

55
// TODO: factor into an independent plugin
66
import visit from "unist-util-visit"
7+
import logger from "@docusaurus/logger"
78
import fs_extra_pkg from "fs-extra"
89
import { spawnSync } from "child_process"
910
const { readJsonSync, writeJsonSync, ensureDirSync } = fs_extra_pkg
1011
import { createHash } from "crypto"
1112

1213
// site version
13-
const sitePkg = readJsonSync("../package.json")
14+
const sitePkg = readJsonSync("../compiler/package.json")
1415
// for version `x.y.z`, only recompute hashes if `x` changes
1516
// to avoid recomputation over minor changes on the website
1617
// (so we only recompute for every major release)
1718
const VERSION = sitePkg.version.replace(/(\..)*$/g, "")
1819

19-
console.log(`rendering snippets ${VERSION}`)
20+
logger.info(`rendering snippets ${VERSION}`)
2021
// language configs
2122
import getLangConfig from "../../language.config.js"
2223
const languageConfig = await getLangConfig()
@@ -91,7 +92,6 @@ async function getOutput(config, input, lang, skipErr) {
9192
memoryCache[pathOut] ||
9293
(cache && readJsonSync(pathOut, { throws: false })) // don't throw an error if file not exist
9394
if (data) {
94-
console.log(`cache hit ${hash}`)
9595
const errorToReport = checkRuntimeError(
9696
lang,
9797
langVersion,
@@ -144,7 +144,7 @@ async function getOutput(config, input, lang, skipErr) {
144144
)
145145
}
146146

147-
console.debug(`${lang}: ${hash}, ${status}, ${error}`)
147+
logger.debug`${lang}: ${hash}, ${status}, ${error}`
148148

149149
const errorToReport = checkRuntimeError(
150150
langVersion,

0 commit comments

Comments
 (0)