This commit is contained in:
Luiz Silva 2025-02-22 18:13:52 -03:00
parent 0908fe53f3
commit e2bb1b7ca2
4 changed files with 25 additions and 11 deletions

15
dist/logger.js vendored
View file

@ -27,11 +27,18 @@ const logger = ({ app, eProducao }) => ({ inquilino, usuario }) => async (level,
if (!eProducao) {
app = `DEV-${app}`;
}
const isNode = typeof process !== "undefined" &&
process.versions?.node &&
process.versions.node !== "";
const isNode = () => {
try {
return (typeof process !== "undefined" &&
process.versions?.node &&
!process.versions.electron);
}
catch {
return false;
}
};
try {
if (isNode && typeof __filename !== "undefined") {
if (isNode() && typeof __filename !== "undefined") {
// Modifica apenas se estiver em Node.js e as variáveis existirem
__filename = __filename.replace(process.cwd(), "");
}