pull/8006/merge
derekderie 1 week ago committed by GitHub
commit 88103b1003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,6 +7,7 @@ module.exports = {
loggers: {}, loggers: {},
init(uid) { init(uid) {
const loggerFormats = [ const loggerFormats = [
winston.format.errors({ stack: true }),
winston.format.label({ label: uid }), winston.format.label({ label: uid }),
winston.format.timestamp() winston.format.timestamp()
] ]
@ -15,7 +16,7 @@ module.exports = {
loggerFormats.push(winston.format.json()) loggerFormats.push(winston.format.json())
} else { } else {
loggerFormats.push(winston.format.colorize()) loggerFormats.push(winston.format.colorize())
loggerFormats.push(winston.format.printf(info => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`)) loggerFormats.push(winston.format.printf(info => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}${info.stack ? '\n' + info.stack : ''}`))
} }
const logger = winston.createLogger({ const logger = winston.createLogger({

@ -61,6 +61,6 @@ module.exports = async (localeCode) => {
WIKI.logger.info(`Fetching locale ${localeCode} from Graph endpoint: [ COMPLETED ]`) WIKI.logger.info(`Fetching locale ${localeCode} from Graph endpoint: [ COMPLETED ]`)
} catch (err) { } catch (err) {
WIKI.logger.error(`Fetching locale ${localeCode} from Graph endpoint: [ FAILED ]`) WIKI.logger.error(`Fetching locale ${localeCode} from Graph endpoint: [ FAILED ]`)
WIKI.logger.error(err.message) WIKI.logger.error(err)
} }
} }

@ -27,6 +27,6 @@ module.exports = async () => {
WIKI.logger.info('Purging orphaned upload files: [ COMPLETED ]') WIKI.logger.info('Purging orphaned upload files: [ COMPLETED ]')
} catch (err) { } catch (err) {
WIKI.logger.error('Purging orphaned upload files: [ FAILED ]') WIKI.logger.error('Purging orphaned upload files: [ FAILED ]')
WIKI.logger.error(err.message) WIKI.logger.error(err)
} }
} }

@ -73,7 +73,7 @@ module.exports = async (pageId) => {
WIKI.logger.info(`Rebuilding page tree: [ COMPLETED ]`) WIKI.logger.info(`Rebuilding page tree: [ COMPLETED ]`)
} catch (err) { } catch (err) {
WIKI.logger.error(`Rebuilding page tree: [ FAILED ]`) WIKI.logger.error(`Rebuilding page tree: [ FAILED ]`)
WIKI.logger.error(err.message) WIKI.logger.error(err)
// exit process with error code // exit process with error code
throw err throw err
} }

@ -89,7 +89,7 @@ module.exports = async (pageId) => {
WIKI.logger.info(`Rendering page ID ${pageId}: [ COMPLETED ]`) WIKI.logger.info(`Rendering page ID ${pageId}: [ COMPLETED ]`)
} catch (err) { } catch (err) {
WIKI.logger.error(`Rendering page ID ${pageId}: [ FAILED ]`) WIKI.logger.error(`Rendering page ID ${pageId}: [ FAILED ]`)
WIKI.logger.error(err.message) WIKI.logger.error(err)
// exit process with error code // exit process with error code
throw err throw err
} }

@ -19,7 +19,7 @@ module.exports = async (svgPath) => {
WIKI.logger.info(`Sanitized SVG file upload: [ COMPLETED ]`) WIKI.logger.info(`Sanitized SVG file upload: [ COMPLETED ]`)
} catch (err) { } catch (err) {
WIKI.logger.error(`Failed to sanitize SVG file upload: [ FAILED ]`) WIKI.logger.error(`Failed to sanitize SVG file upload: [ FAILED ]`)
WIKI.logger.error(err.message) WIKI.logger.error(err)
throw err throw err
} }
} }

Loading…
Cancel
Save