MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / CacheMethods

Function CacheMethods

Source/Engine/Debug/DebugLog.cpp:33–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33bool CacheMethods()
34{
35 if (Internal_SendLog && Internal_SendLogException && Internal_GetStackTrace)
36 return false;
37 ScopeLock lock(Locker);
38 if (Internal_SendLog && Internal_SendLogException && Internal_GetStackTrace)
39 return false;
40
41 auto engine = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly;
42 if (engine == nullptr || !engine->IsLoaded())
43 return true;
44 auto debugLogHandlerClass = engine->GetClass("FlaxEngine.DebugLogHandler");
45 if (!debugLogHandlerClass)
46 return false;
47
48 Internal_SendLog = debugLogHandlerClass->GetMethod("Internal_SendLog", 3);
49 if (!Internal_SendLog)
50 return false;
51
52 Internal_SendLogException = debugLogHandlerClass->GetMethod("Internal_SendLogException", 1);
53 if (!Internal_SendLogException)
54 return false;
55
56 Internal_GetStackTrace = debugLogHandlerClass->GetMethod("Internal_GetStackTrace");
57 if (!Internal_GetStackTrace)
58 return false;
59
60 engine->Unloading.Bind<ClearMethods>();
61
62 return false;
63}
64
65#endif
66

Callers 3

LogMethod · 0.85
LogExceptionMethod · 0.85
GetStackTraceMethod · 0.85

Calls 3

IsLoadedMethod · 0.45
GetClassMethod · 0.45
GetMethodMethod · 0.45

Tested by

no test coverage detected