Skip to content

Commit

Permalink
Remove info log as it currently effects preload options
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Sep 29, 2022
1 parent 7ba1c1c commit dd9700d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ function parse (src) {
}

function _log (message) {
console.log(`[dotenv@${version}][INFO] ${message}`)

This comment has been minimized.

Copy link
@Pashtera

Pashtera Feb 28, 2023

alguien me ayuda por favor a entender mas el programa

}

function _debug (message) {
console.log(`[dotenv@${version}][DEBUG] ${message}`)
}

Expand Down Expand Up @@ -78,8 +74,6 @@ function config (options) {
// Specifying an encoding returns a string instead of a buffer
const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }))

_log('Loading env from .env')

Object.keys(parsed).forEach(function (key) {
if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
process.env[key] = parsed[key]
Expand All @@ -90,9 +84,9 @@ function config (options) {

if (debug) {
if (override === true) {
_debug(`"${key}" is already defined in \`process.env\` and WAS overwritten`)
_log(`"${key}" is already defined in \`process.env\` and WAS overwritten`)
} else {
_debug(`"${key}" is already defined in \`process.env\` and was NOT overwritten`)
_log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`)
}
}
}
Expand All @@ -101,7 +95,7 @@ function config (options) {
return { parsed }
} catch (e) {
if (debug) {
_debug(`Failed to load ${dotenvPath} ${e.message}`)
_log(`Failed to load ${dotenvPath} ${e.message}`)
}

return { error: e }
Expand Down

0 comments on commit dd9700d

Please sign in to comment.