Log only non-default config
This commit is contained in:
1 parent
6bfe590b0d
commit
ec57131d51
2 files changed
+18
-2
No files matched your search
+8
-2
@@ -20,6 +20,7 @@
|
||||
|
||||
const cluster = require("cluster");
|
||||
const logger = require("./logger");
|
||||
const config = require("./config");
|
||||
|
||||
const VERSION = require("../package.json").version;
|
||||
|
||||
@@ -41,8 +42,13 @@ function getConfig() {
|
||||
let conf = [];
|
||||
const keys = Object.keys(process.env);
|
||||
for (let k of keys)
|
||||
if (k.startsWith("GENIEACS_"))
|
||||
conf.push(`${k.slice(9)}=${process.env[k]}`);
|
||||
if (k.startsWith("GENIEACS_")) {
|
||||
const name = k.slice(9);
|
||||
const value = process.env[k];
|
||||
const def = config.getDefault(name);
|
||||
if (def == null || value !== `${def}`)
|
||||
conf.push(`${name}=${value}`);
|
||||
}
|
||||
|
||||
return conf.join(",");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user