Enable tracing by config so we can enable from argv, env variable, or config file (#41)

This commit is contained in:
Eric Eastwood 2022-07-14 11:26:53 -05:00 committed by GitHub
parent ddfe94beab
commit 07bc094890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,13 @@
console.log('server process.env.NODE_ENV', process.env.NODE_ENV);
if (process.argv.includes('--tracing')) {
const assert = require('assert');
const config = require('./lib/config');
const basePort = config.get('basePort');
assert(basePort);
const tracing = config.get('tracing');
if (tracing) {
console.log('Tracing is active 🕵️');
const { startTracing } = require('./tracing/tracing.js');
startTracing();
@ -11,8 +17,6 @@ if (process.argv.includes('--tracing')) {
const express = require('express');
const installRoutes = require('./routes/install-routes');
const config = require('./lib/config');
const basePort = config.get('basePort');
const app = express();
installRoutes(app);