What is the console.log management plan?

in the daily code, we may have a lot of console.log, that may be deleted before each release
do you have any good management methods to enable the test environment to configure whether to print logs, and the production environment to delete console from the code
Today, I think it"s good to see the code written by someone.

    __DEBUG__&&console.log("-sharp--baseUrl:", baseUrl);
    __DEBUG__&&console.log("-sharp--:", `${baseUrl}${url}`);
    __DEBUG__&&console.log("-------------------------");

but I don"t know how to delete this line when packing. I only delete the line with console in the business code. I can"t delete the
in the framework and library. Or do you have any good solutions

?
Jul.15,2021

how can there be a lot of console.log in daily code? delete a function directly after it has been developed. You don't have to keep it.


write an automated program that can be used on build or online versions, and automatically delete all log, info, error, warn
if you already have packaging process tools, such as webpack, you can search for a plug-in that specifically goes to console, or write one yourself

  

see what packaging tool you use. This can be done with the plug-in uglifyjs-webpack-plugin in webpack.

Menu