digitalocean / nginxconfig.io

⚙️ NGINX config generator on steroids 💉
https://do.co/nginxconfig
MIT License
27.66k stars 2.04k forks source link

Suppress logging with NODE_ENV #332

Closed MattIPv4 closed 2 years ago

MattIPv4 commented 2 years ago

Type of Change

What issue does this relate to?

N/A

What should this PR do?

Suppresses logging at the info & log levels when the application is built for production, ensuring only warnings and errors will be logged to the browser console.

The default NODE_ENV has been set to development, which will ensure that all logging is enabled when running the tool locally to test changes etc.

What are the acceptance criteria?

When the tool is built with NODE_ENV set to production (as is done in the DO Spaces & GH Pages Actions workflows), only warnings and errors are logged to the browser console by the tool, not any informational message (such as Prism highlighting, analytics events, etc.).

When the tool is run locally, the default NODE_ENV is set to development automatically, and full logging is enabled with info and log messages appearing in the browser console, such as the Prism highlighting messages and analytics events.