Log
helloz 4/3/2024 Unity3d
example
---lua,It's a wrapper around UnityEngine.Debug.Log----
print('hello')
print('hello',1,true)
--lua call unity---
log('hello')
Log('hello')
LogWarn('warning')
LogError("error msg")
---unity ---
UnityEngine.Debug.Log('hello')
UnityEngine.Debug.LogWarning('hello warning')
UnityEngine.Debug.LogError('hello error')
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
stack trace log
--debug.traceback:
--returns the stack traceback information as a string and does not intercept the execution of logic.
LogError(debug.traceback("hello"))
print(debug.traceback("hello"))
--Throw an exception and output an error log. Interrupt execution logic
error("hello")
1
2
3
4
5
6
7
2
3
4
5
6
7