Open
Conversation
Since the current examples do not work with Unity 5.x I made the following changes to the already existing scripts, and also included a new UnityScript file to the lot. * Change CharmedMatter#1 Application.RegisterLogCallback(HandleLog); this has been deprecated in version 5, so I basically changed it to: public void OnEnable(){ Application.logMessageReceived += HandleLog; } public void OnDisable(){ Application.logMessageReceived -= HandleLog; } Where we send logs when the object is active and stop when it is inactive. * Change CharmedMatter#2 /Send WWW Form to Loggly, replace TOKEN with your unique ID from Loggly var sendLog = new WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D/", loggingForm); Did two things here. The communication per se (the WWW object) is handled on a separate function, mainly because of the coroutine handling in c# and now I force the message to be sent with yield, ergo removing any concurrency issues. My code: StartCoroutine(SendData(loggingForm)); public IEnumerator SendData(WWWForm form){ //Send WWW Form to Loggly, replace TOKEN with your unique ID from Loggly WWW sendLog = new WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D", form); yield return sendLog; } Have fun :)
Just found that Atom has a default set to look at the files and not at the editor's settings when trying to select whether hard or soft tabs. Fixed indentation and already updated Atom's settings so it won't happen again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the current examples do not work with Unity 5.x I made the
following changes to the already existing scripts, and also included a
new UnityScript file to the lot.
this has been deprecated in version 5, so I basically changed it to:
public void OnEnable(){
Application.logMessageReceived += HandleLog;
}
public void OnDisable(){
Application.logMessageReceived -= HandleLog;
}
Where we send logs when the object is active and stop when it is
inactive.
/Send WWW Form to Loggly, replace TOKEN with your unique ID from Loggly
var sendLog = new
WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D/", loggingForm);
Did two things here. The communication per se (the WWW object) is
handled on a separate function, mainly because of the coroutine
handling in c# and now I force the message to be sent with yield, ergo
removing any concurrency issues. My code:
StartCoroutine(SendData(loggingForm));
public IEnumerator SendData(WWWForm form){
//Send WWW Form to Loggly, replace TOKEN with your unique ID
from Loggly
WWW sendLog = new
WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D", form);
yield return sendLog;
}
Have fun :)