This commit is contained in:
Luiz Silva 2025-02-22 14:04:59 -03:00
parent 79a83fe158
commit e1d94a75bd
8 changed files with 27 additions and 16 deletions

8
dist/logger.js vendored
View file

@ -35,14 +35,16 @@ const logger = ({ app, eProducao }) => ({ inquilino, usuario }) => async (level,
],
],
};
const objeto = { streams: [payload] };
const response = await (0, cross_fetch_1.default)(`${LOKI_BASE_URL}${LOKI_ENDPOINT}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ streams: [payload] }),
});
body: JSON.stringify(objeto),
}).catch((a) => a);
if (!response.ok) {
throw new Error(`Erro ${response.status}: ${await response.text()}`);
return [objeto, `Erro ${response.status}: ${await response?.text?.()}`];
}
return [objeto];
};
exports.logger = logger;
//# sourceMappingURL=logger.js.map