Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

Commit 8e81a5b

Browse files
committed
chore: use hexo-log to print log
fix #99
1 parent 36a1855 commit 8e81a5b

File tree

3 files changed

+111
-48
lines changed

3 files changed

+111
-48
lines changed

lib/print.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,38 @@
44

55

66
const colors = require('colors');
7+
const logger = require('hexo-log')();
78

89
/**
9-
* Print log
10-
* @param {...String} argvs Strings to print
10+
* Print error
11+
* @param {String} content Strings to print
1112
* @return {undefined}
1213
*/
13-
function log (...argvs) {
14+
function error (content) {
1415

15-
console.log(`${colors.green('hexo-helper-live2d'.toUpperCase())}: ${argvs}`);
16+
logger.error(`${colors.green('hexo-helper-live2d'.toUpperCase())}: ${content}`);
1617

1718
}
1819

1920
/**
20-
* Print warn
21-
* @param {...String} argvs Strings to print
21+
* Print log
22+
* @param {String} content Strings to print
2223
* @return {undefined}
2324
*/
24-
function warn (...argvs) {
25+
function log (content) {
2526

26-
console.log(`${colors.yellow('hexo-helper-live2d'.toUpperCase())}: ${argvs}`);
27+
logger.info(`${'hexo-helper-live2d'.toUpperCase().inverse}: ${content}`);
2728

2829
}
2930

3031
/**
31-
* Print error
32-
* @param {...String} argvs Strings to print
32+
* Print warn
33+
* @param {String} content Strings to print
3334
* @return {undefined}
3435
*/
35-
function error (...argvs) {
36+
function warn (content) {
3637

37-
console.log(`${colors.red('hexo-helper-live2d'.toUpperCase())}: ${argvs}`);
38+
logger.info(`${'hexo-helper-live2d'.toUpperCase().inverse}: ${content}`);
3839

3940
}
4041

package-lock.json

Lines changed: 96 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"devDependencies": {
77
"commitizen": "^2.9.6",
88
"cz-conventional-changelog": "^2.1.0",
9-
"eslint": "^4.19.0",
9+
"eslint": "^4.19.1",
1010
"live2d-widget-model-wanko": "^1.0.5"
1111
},
1212
"dependencies": {
1313
"colors": "^1.2.1",
1414
"hexo-fs": "^0.2.2",
15+
"hexo-log": "^0.2.0",
1516
"live2d-widget": "^3.0.5",
1617
"lodash": "^4.17.5",
1718
"path": "^0.12.7"

0 commit comments

Comments
 (0)