diff --git a/Objective-J/CPLog.js b/Objective-J/CPLog.js index 8ad4ec238..b4d69c84f 100644 --- a/Objective-J/CPLog.js +++ b/Objective-J/CPLog.js @@ -357,3 +357,10 @@ function _CPLogInitPopup(logWindow) }, false); } #endif + + +#if COMMONJS +CPLogDefault = CPLogPrint; +#else +CPLogDefault = (typeof window === "object" && window.console) ? CPLogConsole : CPLogPopup; +#endif diff --git a/Objective-J/Debug.js b/Objective-J/Debug.js index 27af496b9..68f5aa5d0 100644 --- a/Objective-J/Debug.js +++ b/Objective-J/Debug.js @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +CPLogRegister(CPLogDefault); + // formatting helpers function objj_debug_object_format(aReceiver) diff --git a/Tools/capp/Resources/Templates/Application/index-debug.html b/Tools/capp/Resources/Templates/Application/index-debug.html index 0bd1d11fe..a0e57f42c 100644 --- a/Tools/capp/Resources/Templates/Application/index-debug.html +++ b/Tools/capp/Resources/Templates/Application/index-debug.html @@ -35,6 +35,13 @@ // Uncomment (along with both above) to print backtraces on type check errors: //objj_typecheck_prints_backtrace = true; + + // Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise): + //CPLogUnregister(CPLogDefault); + + // Uncomment to enable a specific logger: + //CPLogRegister(CPLogConsole); + //CPLogRegister(CPLogPopup);