📜 ⬆️ ⬇️

[prog] debug when developing websites

Pages are now all completely dynamic - on the scripts. Also because the program of its kind. But the debugging question is somehow weakly raised (if we compare it with C ++ the same). It all comes down to eye evaluation, editing, and so on in a circle. Error messages are displayed in the same HTML page - it's easier.


But what are the options?

Option number one - all the same logs. A function is created to display the error. Further, she is required to write a message to the log with the date, page, URL (one script can be called at different URLs), and other values ​​as necessary. In addition, you can send a message to the mail to the admin (which is not what the users have harassed about the site of the problem). And the page to display simply "We are all bad, but thank you, we are already vkurse" :) well, or the same text for the period of site development. And so - the details of third-party users to anything.
')
Possible disadvantages - it would be good to implement a system against DoS. And then so the letters can spam. Well, it will be necessary to cut the log periodically.

Option two - more suitable for the development period. Embed a debugging library in every page or engine. It will call, for example, by adding "& dbg = true" to the URL (manually). In this case, the page, among other things, will be filled with any debugging information - paths, variables, links, query processing time, etc.

Essno about this is not to spread, so that users do not make fun of it later;) Yes, and it can be turned off. But for debugging it happens very well. Especially if the page of the pieces is going, which FIG knows where to come from.

It was all about the server part. About debugging JS / DHTML, etc., and everything seems to be so clear - there are both scripts and utilities.

Who knows what other options and uses?

Source: https://habr.com/ru/post/1083/


All Articles