Application
.RegisterLogCallback
Manual
Reference
Scripting
Scripting
>
Runtime Classes
>
Application
Application
.RegisterLogCallback
Menu
Overview
Runtime Classes
Attributes
Enumerations
Editor Classes
Enumerations
History
Index
Application
All Members
Class Variables
absoluteURL
backgroundLoadingPriority
dataPath
isEditor
isLoadingLevel
isPlaying
isWebPlayer
levelCount
loadedLevel
loadedLevelName
persistentDataPath
platform
runInBackground
srcValue
streamedBytes
systemLanguage
targetFrameRate
temporaryCachePath
unityVersion
webSecurityEnabled
Class Functions
CancelQuit
CanStreamedLevelBeLoaded
CaptureScreenshot
ExternalCall
ExternalEval
GetStreamProgressForLevel
LoadLevel
LoadLevelAdditive
LoadLevelAdditiveAsync
LoadLevelAsync
OpenURL
Quit
RegisterLogCallback
RegisterLogCallbackThreaded
Delegates
LogCallback
static
function
RegisterLogCallback (handler :
Application.LogCallback
) :
void
Description
Register a delegate to be called on log messages.
Pass
null
to remove log handler.
JavaScripts
JavaScript
C#
Boo
var
output :
String
=
""
;
var
stack :
String
=
""
;
function
OnEnable
() {
Application.RegisterLogCallback
(HandleLog);
}
function
OnDisable
() {
// Remove callback when object goes out of scope
Application.RegisterLogCallback
(null);
}
function
HandleLog (logString :
String
, stackTrace :
String
, type :
LogType
) {
output = logString;
stack = stackTrace;
}
using UnityEngine;
using System.Collections;
public
class
example :
MonoBehaviour
{
public
string
output =
""
;
public
string
stack =
""
;
void
OnEnable
() {
Application.RegisterLogCallback
(HandleLog);
}
void
OnDisable
() {
Application.RegisterLogCallback
(null);
}
void
HandleLog(
string
logString,
string
stackTrace,
LogType
type) {
output = logString;
stack = stackTrace;
}
}
import
UnityEngine
import
System.Collections
class
example(
MonoBehaviour
):
public
output as
string
=
public
stack as
string
=
def
OnEnable
():
Application.RegisterLogCallback
(HandleLog)
def
OnDisable
():
Application.RegisterLogCallback
(null)
def HandleLog(logString as
string
, stackTrace as
string
, type as
LogType
):
output = logString
stack = stackTrace
See Also:
Application.LogCallback
,
LogType
.