diff --git a/unity/Assets/core/upm/Runtime/Resources/puerts/log.mjs b/unity/Assets/core/upm/Runtime/Resources/puerts/log.mjs index 7b2bb282d4..9c3580291f 100644 --- a/unity/Assets/core/upm/Runtime/Resources/puerts/log.mjs +++ b/unity/Assets/core/upm/Runtime/Resources/puerts/log.mjs @@ -63,6 +63,11 @@ if (UnityEngine_Debug || !global.console) { if (console_org) console_org.error.apply(null, Array.prototype.slice.call(arguments)); UnityEngine_Debug.LogError(toString(arguments)); } + + console.debug = function() { + if (console_org) console_org.debug.apply(null, Array.prototype.slice.call(arguments)); + UnityEngine_Debug.Log(toString(arguments)); + } console.trace = function() { if (console_org) console_org.trace.apply(null, Array.prototype.slice.call(arguments)); @@ -83,6 +88,14 @@ if (UnityEngine_Debug || !global.console) { console.time = function(name){ timeRecorder.set(name,+new Date); } + console.timeLog = function(name, ...args){ + const startTime = timeRecorder.get(name); + if(startTime){ + console.log(String(name)+": "+(+new Date - startTime)+" ms", ...args); + }else{ + console.warn("Timer '" + String(name)+ "' does not exist"); + }; + } console.timeEnd = function(name){ const startTime = timeRecorder.get(name); if(startTime){