Application.RegisterLogCallback Manual     Reference     Scripting  
Scripting > Runtime Classes > Application
Application.RegisterLogCallback

static function RegisterLogCallback (handler : Application.LogCallback) : void

Description

Register a delegate to be called on log messages.

Pass null to remove log handler.

var output = "";
var stack= "";

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;
}

See Also: Application.LogCallback, LogType.