Closed esseks closed 11 years ago
debug.js should be required however, the debug statements needs it, unless you want to strip also all the code.
It's possible to add a meta tag like this
<meta name="mode" content="production" />
Debug mode should will be triggered by invoking bitsd.py
with the --developer-mode
flag, which is meant to activate all functions that help debugging (like module reload on changes) but are unwanted or even unsafe on a production machine.
I can easily include or exclude debug.js
and append a tag to the head of the document when the aforementioned flag is set, do you need anything else?
Only add that tag.
No way to remove debug.js without breaking all badly...
This line:
debug.setLevel(query("meta[name='mode']").content);
throws an Uncaught Type Error
. You have to test code before pushing to the upstream repo. Otherwise, feel free to experiment in your fork.
I committed the necessary server code and I changed a require line in you JS, so that at least it does not fail. Now fix it.
I fixed the code for you. Please never commit to the upstream repo again, unless at least another developer asked you to or the fix is so trivial (e.g. typos) that it is not suitable for a pull request. Direct push is certainly not ok for issues and code changes.
Currently, the JS code is perfoming verbose logging.
Logging should be disabled in production and
debug.js
only required on test machines.