Log level: 0 None, 1 Error, 2 Warning, 3 Info, 4 debug
A global _dump_level variable gets consulted when the function is used. The default is 2, Warning.
So by default, until we start changing things, this will suppress most of the existing dump statements. Some are slipping through the cracks based on when the function replacement happens, but I'm happy with it. We also prepend the dump msg with a label for the log level.
_dump_level could be locally customized with server/skin/custom.js
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19323
dcc99617-32d9-48b4-a31d-
7c20da2025e4
<overlay id="openils_util_overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <script>dump('Loading OpenILS/util_overlay_chrome.xul for ' + location.href + '\n');</script>
<scripts id="openils_util_scripts">
- <script>dump('starting openils_util_overlay\n');</script>
+ <script>
+ <![CDATA[
+ var _dump_level = 2; // 0 None, 1 Error, 2 Warning, 3 Info, 4 debug
+ if (!_original_dump) {
+ var _original_dump = window.dump;
+ window.dump = function (msg,level) {
+ try {
+ if (typeof level == 'undefined') { level = 4; }
+ if (level > _dump_level) { return; }
+ switch(level) {
+ case 1: case 'error': _original_dump('error: '); break;
+ case 2: case 'warn': _original_dump('warn: '); break;
+ case 3: case 'info': _original_dump('info: '); break;
+ case 4: case 'debug': _original_dump('debug: '); break;
+ }
+ _original_dump(msg);
+ } catch(E) {
+ alert('error in dump: ' + E + '\nmsg = ' + msg + '\nlevel = ' + level + '\n');
+ }
+ };
+ }
+ ]]>
+ </script>
<script type="text/javascript" src="../main/constants.js" />
<script type="text/javascript" src="util/utils.js" />
<script type="text/javascript" src="util/CGI.js" />
<overlay id="openils_util_overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script>dump('Loading OpenILS/util_overlay_offline.xul\n');</script>
+ <script>dump('Loading OpenILS/util_overlay_offline.xul for ' + location.href + '\n');</script>
+ <script>
+ <![CDATA[
+ var _dump_level = 2; // 0 None, 1 Error, 2 Warning, 3 Info, 4 debug
+ if (!_original_dump) {
+ var _original_dump = window.dump;
+ window.dump = function (msg,level) {
+ try {
+ if (typeof level == 'undefined') { level = 4; }
+ if (level > _dump_level) { return; }
+ switch(level) {
+ case 1: case 'error': _original_dump('error: '); break;
+ case 2: case 'warn': _original_dump('warn: '); break;
+ case 3: case 'info': _original_dump('info: '); break;
+ case 4: case 'debug': _original_dump('debug: '); break;
+ }
+ _original_dump(msg);
+ } catch(E) {
+ alert('error in dump: ' + E + '\nmsg = ' + msg + '\nlevel = ' + level + '\n');
+ }
+ };
+ }
+ ]]>
+ </script>
<scripts id="openils_util_scripts">
<script type="text/javascript" src="../main/constants.js" />
<script type="text/javascript" src="util/utils.js" />
<overlay id="openils_util_overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <script>dump('Loading OpenILS/util_overlay.xul for ' + location.href + '\n');</script>
<scripts id="openils_util_scripts">
- <script>dump('starting openils_util_overlay in ' + location.href + '\n');</script>
+ <script>
+ <![CDATA[
+ var _dump_level = 2; // 0 None, 1 Error, 2 Warning, 3 Info, 4 debug
+ if (!_original_dump) {
+ var _original_dump = window.dump;
+ window.dump = function (msg,level) {
+ try {
+ if (typeof level == 'undefined') { level = 4; }
+ if (level > _dump_level) { return; }
+ switch(level) {
+ case 1: case 'error': _original_dump('error: '); break;
+ case 2: case 'warn': _original_dump('warn: '); break;
+ case 3: case 'info': _original_dump('info: '); break;
+ case 4: case 'debug': _original_dump('debug: '); break;
+ }
+ _original_dump(msg);
+ } catch(E) {
+ alert('error in dump: ' + E + '\nmsg = ' + msg + '\nlevel = ' + level + '\n');
+ }
+ };
+ }
+ ]]>
+ </script>
<script>var djConfig = { 'baseUrl' : '/js/dojo/dojo/',parseOnLoad: true,isDebug:false };</script>
<script type="text/javascript" src="/js/dojo/dojo/dojo.js" />
<script type="text/javascript" src="/IDL2js" />