Sample Codes


using UnityEngine;
using NetLog; // By adding NetLog with using, method can be called in Log.XXX format.

public class LogTest : MonoBehaviour
{

 void Start()
 {

  // By setting Enabled property to true/false, log output can be controlled.
  //Set to false is much better for an instance of application release
  Log.Enabled = Debug.isDebugBuild;
 }


 void OnGUI()
 {
 if (GUI.Button(new Rect(20, 20, 200, 40), "CONNECT !"))
 {

  // Connect to LogReceiver running at192.168.50.200 on port 5656
  Log.StartRemoteLogEz("192.168.50.200", 5656);



  // Following code will not be displayed in log
  //Because StartRemoteLog is an asynchronous method (becomes usable after delayed by one frame)
  Log.d("Try connect");
 }


 if (GUI.Button(new Rect(20, 70, 200, 40), "Log.v"))
 {

  // output VERBOSE level log
  Log.v("VERBOSE");
 }


 if (GUI.Button(new Rect(20, 120, 200, 40), "Log.d"))
 {

  // output DEBUG level log
  Log.d("DEBUG", "param1", "param2", "...");
 }


 if (GUI.Button(new Rect(20, 170, 200, 40), "Log.i"))
 {

  // output INFO level log
  Log.i("INFO");
 }


 if (GUI.Button(new Rect(20, 220, 200, 40), "Log.w"))
 {

  // output WARN level log
  Log.w("WARN");
 }


 if (GUI.Button(new Rect(20, 270, 200, 40), "Log.e"))
 {

  // output ERROR level log
  Log.e("ERROR");
 }


 if (GUI.Button(new Rect(20, 320, 200, 40), "Log.f"))
 {

  // output FATAL level log
  Log.f("FATAL");
 }


 if (GUI.Button(new Rect(20, 370, 200, 40), "Screen Shot"))
 {

  // take current screenshot and send it to LogReceiver
  Log.ScreenShot();
 }
}