mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
* feat: add prettier and commit hooks * style(*): prettier format * fix(eslint): parsing error: Unexpected token ... * style(eslint): eslint --fix * style(bilibili): fix `no-undef` and `no-unused-vars` * style(jiandan): fix eqeqeq * style(pixiv): disable `no-constant-condition` rule for eslint * fix(pixiv): use template string * style(toutiao): remove unused variables * style(weibo): use `forEach` instead of `map` The array has no return value, you should use `forEach` instead of `map` * chore(hooks): add eslint hooks * chore(hooks): switch from husky to yorkie * style(zhihu): prettier format * style(docs): fix vuepress custom container https://vuepress.vuejs.org/guide/markdown.html#custom-containers * chore(prettier): set a more reasonable `printWidth` value * style(*): better prettier format
30 lines
780 B
JavaScript
30 lines
780 B
JavaScript
const winston = require('winston');
|
|
|
|
const logger = winston.createLogger({
|
|
level: 'info',
|
|
format: winston.format.json(),
|
|
transports: [
|
|
//
|
|
// - Write to all logs with level `info` and below to `combined.log`
|
|
// - Write all logs error (and below) to `error.log`.
|
|
//
|
|
new winston.transports.File({
|
|
filename: 'logs/error.log',
|
|
level: 'error',
|
|
}),
|
|
new winston.transports.File({ filename: 'logs/combined.log' }),
|
|
],
|
|
});
|
|
|
|
//
|
|
// If we're not in production then log to the `console` with the format:
|
|
// `${info.level}: ${info.message} JSON.stringify({ ...rest }) `
|
|
//
|
|
logger.add(
|
|
new winston.transports.Console({
|
|
format: winston.format.simple(),
|
|
})
|
|
);
|
|
|
|
module.exports = logger;
|