public static LogObject GetInstance() { if (!_initialized) { _instance = SingletonManager.AddComponent <LogObject> (); _initialized = true; } return(_instance); }
private static void log(object owner, string name, object[] values) { string logStr = GetDebugString(owner, name, values); if (UnityEngine.Application.platform == RuntimePlatform.WindowsEditor || UnityEngine.Application.platform == RuntimePlatform.OSXEditor) { if (name == WARN) { Debug.LogWarning(logStr); } else if (name == ERROR) { Debug.LogError(logStr); } else if (name == FATAL) { Debug.LogError(logStr); } else { Debug.Log(logStr); } } if (showInApp) { LogObject.GetInstance().logStr += logStr + "\n"; } if (_persistentDataPath == "") { try { _persistentDataPath = ApplicationUtils.GetProcessDirectory(); } catch (Exception e) { Debug.LogError(e); } } if (_persistentDataPath != "") { try { string fileName = _persistentDataPath + "/" + name + ".log"; FileUtils.AppendTextToFile(logStr + "\n", fileName); } catch (Exception e) { Debug.LogError(e); } } }
public static LogObject GetInstance () { if (!_initialized) { _instance = SingletonManager.AddComponent<LogObject> (); _initialized = true; } return _instance; }