From 75a05ff15dca45ba3ebea7ca635d135a13530846 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 8 Sep 2015 20:52:18 -0700 Subject: [PATCH] Reduce logging spam in omniTools/magBalls --- examples/libraries/utils.js | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/examples/libraries/utils.js b/examples/libraries/utils.js index 10694b11f5..1275975fd8 100644 --- a/examples/libraries/utils.js +++ b/examples/libraries/utils.js @@ -96,20 +96,44 @@ mergeObjects = function(proto, custom) { return result; } +LOG_WARN = 1; + logWarn = function(str) { - print(str); + if (LOG_WARN) { + print(str); + } } +LOG_ERROR = 1; + logError = function(str) { - print(str); + if (LOG_ERROR) { + print(str); + } } +LOG_INFO = 1; + logInfo = function(str) { - print(str); + if (LOG_INFO) { + print(str); + } } +LOG_DEBUG = 0; + logDebug = function(str) { - print(str); + if (LOG_DEBUG) { + print(str); + } +} + +LOG_TRACE = 0; + +logTrace = function(str) { + if (LOG_TRACE) { + print(str); + } } // Computes the penetration between a point and a sphere (centered at the origin)