Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load dotenv lib at start #6701

Merged
merged 2 commits into from Jul 16, 2020
Merged

load dotenv lib at start #6701

merged 2 commits into from Jul 16, 2020

Conversation

imaksp
Copy link
Contributor

@imaksp imaksp commented Jun 17, 2020

allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file

Description of what you did:

Load env vars from env file at starpi start, allows setting STRAPI_LOG_LEVEL, STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_TIMESTAMP etc related to #6693.

but it might not fix it as middleware config is overriding log level to 'debug', using default json file, not sure if I can use this env variable(STRAPI_LOG_LEVEL) in that logger middlerware's defaults json file, but it allows use of other vars like STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_TIMESTAMP & STRAPI_LOG_FORCE_COLOR

allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file

Signed-off-by: Akash P <aksdevac@gmail.com>
@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

Merging #6701 into master will increase coverage by 0.19%.
The diff coverage is 90.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6701      +/-   ##
==========================================
+ Coverage   19.86%   20.05%   +0.19%     
==========================================
  Files         857      858       +1     
  Lines       12078    12050      -28     
  Branches     1963     1951      -12     
==========================================
+ Hits         2399     2417      +18     
+ Misses       8094     8062      -32     
+ Partials     1585     1571      -14     
Flag Coverage Δ
#front 14.68% <0.00%> (+0.01%) ⬆️
#unit 42.45% <95.00%> (+1.18%) ⬆️
Impacted Files Coverage Δ
...-manager/admin/src/components/DynamicZone/index.js 0.00% <ø> (ø)
...lder/admin/src/containers/FormModal/utils/forms.js 0.00% <0.00%> (ø)
.../containers/InputModalStepper/InputModalStepper.js 0.00% <ø> (ø)
...-upload/admin/src/containers/ModalStepper/index.js 0.00% <ø> (ø)
...-permissions/admin/src/components/ListRow/index.js 0.00% <ø> (ø)
...rmissions/controllers/validation/email-template.js 95.00% <95.00%> (ø)
packages/strapi-plugin-upload/services/Upload.js 17.03% <0.00%> (-0.62%) ⬇️
...kages/strapi-admin/admin/src/translations/index.js 100.00% <0.00%> (ø)
...trapi-admin/admin/src/containers/AuthPage/index.js 0.00% <0.00%> (ø)
...trapi-plugin-email/admin/src/translations/index.js 0.00% <0.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6774667...17ecb34. Read the comment docs.

@@ -1,6 +1,14 @@
'use strict';

// Dependencies.
const dotenv = require('dotenv');

if(process.env.ENV_PATH) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to do the if statement here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok removed it.

@alexandrebodin alexandrebodin added source: core:strapi Source is core/strapi package issue: enhancement Issue suggesting an enhancement to an existing feature labels Jul 16, 2020
Signed-off-by: Akash P <aksdevac@gmail.com>
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! thanks :)

@alexandrebodin alexandrebodin added this to the 3.0.6 milestone Jul 16, 2020
@alexandrebodin alexandrebodin merged commit e2323aa into strapi:master Jul 16, 2020
gilfernandes pushed a commit to onepointconsulting/strapi that referenced this pull request Aug 13, 2020
* load dotenv lib at start
allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file

Signed-off-by: Akash P <aksdevac@gmail.com>

* remove extra if statement

Signed-off-by: Akash P <aksdevac@gmail.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: core:strapi Source is core/strapi package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants