[fix] conf

This commit is contained in:
roydfalk 2024-08-28 06:15:01 +02:00
parent 9893e60bf3
commit 8ecd0bd63e

View file

@ -221,7 +221,7 @@ namespace _espe.conf
conf_raw : any
) : void
{
const version : int = conf_raw["version"];
const version : int = (conf_raw["version"] ?? 4);
_data = {
"general": (
((node_general) => ({
@ -229,51 +229,53 @@ namespace _espe.conf
"verification_secret": (node_general["verification_secret"] ?? null),
})) (conf_raw["general"] ?? {})
),
"log": (() => {
switch (version) {
case 1: {
return [
{
"kind": "stdout",
"data": {
"threshold": ((conf_raw["general"] ?? {})["verbosity"] ?? "notice"),
}
},
];
break;
}
case 2:
case 3:
case 4: {
const node_log = (
conf_raw["log"]
??
[
"log": (
(() => {
switch (version) {
case 1: {
return [
{
"kind": "console",
"kind": "stdout",
"data": {
"threshold": ((conf_raw["general"] ?? {})["verbosity"] ?? "notice"),
}
},
]
);
return (
node_log.map(
(node_log_entry : any) => ({
"kind": node_log_entry["kind"],
"data": Object.assign(
{
"format": "human_readable",
"threshold": "notice",
},
(node_log_entry["data"] ?? {})
)
})
)
);
break;
];
break;
}
case 2:
case 3:
case 4: {
const node_log = (
conf_raw["log"]
??
[
{
"kind": "stdout",
"data": {
}
},
]
);
return (
node_log.map(
(node_log_entry : any) => ({
"kind": node_log_entry["kind"],
"data": Object.assign(
{
"format": "human_readable",
"threshold": "notice",
},
(node_log_entry["data"] ?? {})
)
})
)
);
break;
}
}
}
}) (),
}) ()
),
"server": (
((node_server) => ({
"host": (() => {