refactor: unify log format with new logger utility (#5994)

Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Joshua Chen 2021-12-21 00:24:59 +08:00 committed by GitHub
parent faef753730
commit 770418f8d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 717 additions and 650 deletions

View file

@ -51,7 +51,7 @@ import {
translateLoadedContent,
getLoadedContentTranslationFiles,
} from './translations';
import chalk from 'chalk';
import logger from '@docusaurus/logger';
import {getVersionTags} from './tags';
import {createVersionRoutes} from './routes';
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
@ -203,11 +203,7 @@ export default function pluginContentDocs(
try {
return await doLoadVersion(versionMetadata);
} catch (e) {
console.error(
chalk.red(
`Loading of version failed for version "${versionMetadata.versionName}"`,
),
);
logger.error`Loading of version failed for version name=${versionMetadata.versionName}`;
throw e;
}
}