build
This commit is contained in:
parent
79a83fe158
commit
e1d94a75bd
8 changed files with 27 additions and 16 deletions
8
dist/logger.js
vendored
8
dist/logger.js
vendored
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue