This commit is contained in:
chk
2026-06-14 13:40:38 +02:00
parent e6abe047dc
commit c68ce406a6
8 changed files with 108 additions and 31 deletions

18
src/log.js Normal file
View File

@@ -0,0 +1,18 @@
// Schlanker, konsistenter Logger. Alle Ausgaben mit Zeitstempel + [fsvc]-Präfix,
// damit man im Container-Log Fileservice-Zeilen sofort erkennt.
// Im Test (NODE_ENV=test) still, damit die Jest-Ausgabe sauber bleibt.
const silent = process.env.NODE_ENV === 'test';
const ts = () => new Date().toISOString();
function info(...args) {
if (!silent) console.log(`${ts()} [fsvc]`, ...args);
}
function warn(...args) {
if (!silent) console.warn(`${ts()} [fsvc] ⚠`, ...args);
}
function error(...args) {
if (!silent) console.error(`${ts()} [fsvc] ✖`, ...args);
}
module.exports = { info, warn, error };