.
This commit is contained in:
parent
6a0da63093
commit
0908fe53f3
4 changed files with 31 additions and 8 deletions
17
dist/logger.js
vendored
17
dist/logger.js
vendored
|
|
@ -27,9 +27,20 @@ const logger = ({ app, eProducao }) => ({ inquilino, usuario }) => async (level,
|
|||
if (!eProducao) {
|
||||
app = `DEV-${app}`;
|
||||
}
|
||||
const isNode = typeof process !== "undefined" && process.versions?.node;
|
||||
if (isNode && __filename) {
|
||||
__filename = __filename.replace(process.cwd(), "");
|
||||
const isNode = typeof process !== "undefined" &&
|
||||
process.versions?.node &&
|
||||
process.versions.node !== "";
|
||||
try {
|
||||
if (isNode && typeof __filename !== "undefined") {
|
||||
// Modifica apenas se estiver em Node.js e as variáveis existirem
|
||||
__filename = __filename.replace(process.cwd(), "");
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
// Ignora erros de variáveis não definidas no navegador
|
||||
if (!(error instanceof ReferenceError)) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
if (local) {
|
||||
detalhes = [`${(0, variaveisComuns_1.nomeVariavel)({ local })}="${local}"`];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue