mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 04:11:26 +08:00
feat: disable console log for pkg
This commit is contained in:
@@ -27,6 +27,7 @@ module.exports = {
|
||||
},
|
||||
get value() {
|
||||
return {
|
||||
isPackage: envs.isPackage,
|
||||
connect: {
|
||||
port: envs.PORT || 1200, // 监听端口
|
||||
socket: envs.SOCKET || null, // 监听 Unix Socket, null 为禁用
|
||||
|
||||
@@ -3,7 +3,14 @@ const config = require('./config');
|
||||
|
||||
module.exports = {
|
||||
init: (conf) => {
|
||||
config.set(conf);
|
||||
config.set(
|
||||
Object.assign(
|
||||
{
|
||||
isPackage: true,
|
||||
},
|
||||
conf
|
||||
)
|
||||
);
|
||||
app = require('./app');
|
||||
},
|
||||
request: (path) =>
|
||||
|
||||
@@ -21,11 +21,13 @@ const logger = winston.createLogger({
|
||||
// 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.combine(winston.format.colorize(), winston.format.simple()),
|
||||
silent: process.env.NODE_ENV === 'test',
|
||||
})
|
||||
);
|
||||
if (!config.isPackage) {
|
||||
logger.add(
|
||||
new winston.transports.Console({
|
||||
format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
|
||||
silent: process.env.NODE_ENV === 'test',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = logger;
|
||||
|
||||
Reference in New Issue
Block a user