Skip to content

Commit

Permalink
Merge pull request #107 from AthennaIO/develop
Browse files Browse the repository at this point in the history
fix(env): adjust env validation
  • Loading branch information
jlenon7 authored Oct 26, 2022
2 parents 8d952f3 + 36e9b15 commit 8e548cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "2.0.0",
"version": "2.0.1",
"description": "The plug and play Node.js framework.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class Repl extends Command {
* @return {Promise<void>}
*/
async handle() {
process.env.BOOT_LOGS = '(false)'
process.env.SHUTDOWN_LOGS = '(false)'
process.env.BOOT_LOGS = 'false'
process.env.SHUTDOWN_LOGS = 'false'

const application = await new Ignite().fire()

Expand Down
10 changes: 8 additions & 2 deletions src/Helpers/ProviderHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { Config } from '@athenna/config'
import { Module } from '@athenna/common'
import { Is, Module } from '@athenna/common'
import { LoggerHelper } from '#src/Helpers/LoggerHelper'
import { Logger } from '@athenna/logger'

Expand Down Expand Up @@ -116,7 +116,13 @@ export class ProviderHelper {
const provider = new Provider()
let logger = LoggerHelper.get()

if (method === 'shutdown' && Env('SHUTDOWN_LOGS') !== false) {
let shutdownLogsEnv = Env('SHUTDOWN_LOGS')

if (Is.String(shutdownLogsEnv)) {
shutdownLogsEnv = shutdownLogsEnv === 'true'
}

if (method === 'shutdown' && shutdownLogsEnv !== false) {
logger = new Logger().channel('application')
}

Expand Down

0 comments on commit 8e548cb

Please sign in to comment.