Wrap calls to console.log through LoggerUtil (prefixes).

This commit is contained in:
Daniel Scalzi
2018-08-22 14:21:49 -04:00
parent 37606dc8d2
commit 0346597afe
12 changed files with 151 additions and 103 deletions

View File

@@ -3,6 +3,7 @@ const path = require('path')
const request = require('request')
const ConfigManager = require('./configmanager')
const logger = require('./loggerutil')('%c[DistroManager]', 'color: #a02d2a; font-weight: bold')
/**
* Represents the download information
@@ -168,7 +169,7 @@ class Module {
} catch (err) {
// Improper identifier
console.error('Improper ID for module', this.identifier, err)
logger.error('Improper ID for module', this.identifier, err)
}
}
@@ -567,10 +568,10 @@ exports.pullLocal = function(){
exports.setDevMode = function(value){
if(value){
console.log('%c[DistroManager]', 'color: #a02d2a; font-weight: bold', 'Developer mode enabled.')
console.log('%c[DistroManager]', 'color: #a02d2a; font-weight: bold', 'If you don\'t know what that means, revert immediately.')
logger.log('Developer mode enabled.')
logger.log('If you don\'t know what that means, revert immediately.')
} else {
console.log('%c[DistroManager]', 'color: #a02d2a; font-weight: bold', 'Developer mode disabled.')
logger.log('Developer mode disabled.')
}
DEV_MODE = value
}
@@ -584,11 +585,4 @@ exports.isDevMode = function(){
*/
exports.getDistribution = function(){
return data
}
/*async function debug(){
const d = await exports.pullRemote()
console.log(d)
}
debug()*/
//console.log(DistroIndex.fromJSON(JSON.parse(require('fs').readFileSync('../distribution.json', 'utf-8'))))
}