mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-21 10:37:51 +02:00
refactor: unify log format with new logger utility (#5994)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
faef753730
commit
770418f8d2
66 changed files with 717 additions and 650 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import shell from 'shelljs';
|
||||
import logger from '@docusaurus/logger';
|
||||
|
||||
type FileLastUpdateData = {timestamp?: number; author?: string};
|
||||
|
||||
|
@ -36,7 +37,7 @@ export async function getFileLastUpdate(
|
|||
if (!shell.which('git')) {
|
||||
if (!showedGitRequirementError) {
|
||||
showedGitRequirementError = true;
|
||||
console.warn('Sorry, the docs plugin last update options require Git.');
|
||||
logger.warn('Sorry, the docs plugin last update options require Git.');
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -51,8 +52,8 @@ export async function getFileLastUpdate(
|
|||
);
|
||||
}
|
||||
return getTimestampAndAuthor(result.stdout.trim());
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue