Only log request error stacktrace if RIMGU_DEBUG is set

This commit is contained in:
3nprob 2021-11-25 21:49:48 +09:00
parent 34842fcbae
commit 587e1ba268
2 changed files with 3 additions and 2 deletions

View File

@ -7,4 +7,5 @@ export default {
imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null, imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null,
use_api: process.env.RIMGU_USE_API && process.env.RIMGU_USE_API !== 'false', use_api: process.env.RIMGU_USE_API && process.env.RIMGU_USE_API !== 'false',
page_title: process.env.RIMGU_PAGE_TITLE || 'rimgu', page_title: process.env.RIMGU_PAGE_TITLE || 'rimgu',
debug: process.env.RIMGU_DEBUG && process.env.RIMGU_DEBUG !== 'false',
}; };

View File

@ -15,9 +15,9 @@ const server = Hapi.server({
relativeTo: Path.join(__dirname, 'static') relativeTo: Path.join(__dirname, 'static')
} }
}, },
debug: { debug: CONFIG.debug ? {
request: ['error'] request: ['error']
}, } : {},
}); });
server.events.on('stop', () => { server.events.on('stop', () => {
console.log('Server stopped.'); console.log('Server stopped.');