This article describes the process of using javascript for debugging. We recommend it to you. Recently, we know that the web Front-end has become very heavy a few years ago. Various js frameworks, various objects, and more projects will extract public modules.
The UI display of these modules is the same, but the background logic is different. For example, when we are doing business travel, there is usually a cost-center js public module, the customer enters the cost center when booking a ticket, which is distributed on the online, offline, and app booking terminals. This facilitates monthly settlement with the customer's company in the future.
We also know that the project is bigger and more complicated. After SOA is realized, many problems arise. Just like a theory in the web, all front-end data is untrusted, why isn't the interface data of the other team? In the past, when the project was small, it won't be so unconfident, and it will only record the logs when the Logic error occurs, normal business processes are rarely recorded. After all, info logs are not beautiful, but also consume server bandwidth and the web performance.
However, the project is too big. When you encounter a strange bug in the project one day, you can trace the interface line by line with the help of incomplete logs, but there are too many parameters, the interface parameter data cannot be restored accurately, but you are confident that it is definitely a problem returned by the interface, but you cannot get the complete message. At this time, you cannot find the interface provider, that was helpless at that time. I thought it would be better to have logs on each line.
With the lessons learned, the trend of recording process logs is becoming increasingly prevalent, and finally a major event at the beginning of the year is brewing. I am confused about a lot of things. The web backend is like this, does the current heavy front-end need to record logs? We know that since it is a common js module, this module must have encapsulated some methods by itself. It is definitely not allowed for a third-party program to operate on its own text nodes, as shown below:
The Code is as follows:
Company:
Employee Name: