Migrate more console messages to debug()

This commit is contained in:
D. Berge
2022-05-12 22:09:08 +02:00
parent 1b925502bc
commit 3ed8339aa3
4 changed files with 58 additions and 10 deletions

View File

@@ -1,9 +1,11 @@
#!/usr/bin/node
const { INFO, DEBUG } = require('DOUGAL_ROOT/debug')(__filename);
async function main () {
// Check that we're running against the correct database version
const version = require('./lib/version');
console.log("Running version", await version.describe());
INFO("Running version", await version.describe());
version.compatible()
.then( (versions) => {
const api = require('./api');
@@ -17,12 +19,13 @@ async function main () {
const eventManagerPath = [__dirname, "events"].join("/");
const eventManager = fork(eventManagerPath, /*{ stdio: 'ignore' }*/);
console.info("Versions", versions);
INFO("Versions:", versions);
process.on('exit', () => eventManager.kill());
})
.catch( ({current, wanted, component}) => {
console.error(`Fatal error: incompatible ${component} version ${current} (wanted: ${wanted})`);
ERROR(`Fatal error: incompatible ${component} version ${current} (wanted: ${wanted})`);
process.exit(1);
});
}