// Token: 0x0600586F RID: 22639 RVA: 0x001E9FF8 File Offset: 0x001E83F8 private void OnEnable() { if (VRCLog.Instance != null && VRCLog.Instance != this) { UnityEngine.Debug.LogError("Instance of VRCLog already created! Destroying new one. "); UnityEngine.Object.Destroy(base.gameObject); return; } VRCLog.Instance = this; if (this.uploadLog == null) { this.uploadLog = new ConcurrentQueue <string>(34); } if (Application.isEditor && !VRCLog.profilerEnabled) { this.logHandler = new VRCLog.ThreadedDiskWriteHandler(UnityEngine.Debug.logger.logHandler, this.uploadLog); } else { this.logHandler = new VRCLog.ThreadedDiskWriteHandler(null, this.uploadLog); } UnityEngine.Debug.logger.logHandler = this.logHandler; Application.logMessageReceivedThreaded += this.LogMessageReceived; if (Application.isEditor) { foreach (LogType logType in Enum.GetValues(typeof(LogType)).Cast <LogType>()) { this._savedStackTraceLogType[(int)logType] = Application.GetStackTraceLogType(logType); Application.SetStackTraceLogType(logType, StackTraceLogType.ScriptOnly); } } UnityEngine.Debug.Log(VRCApplicationSetup.GetBuildDescriptionString()); }
// Token: 0x0600587E RID: 22654 RVA: 0x001EA664 File Offset: 0x001E8A64 public void LogFormat(LogType logType, UnityEngine.Object context, string format, params object[] args) { if (logType != LogType.Log && logType != LogType.Warning) { StackTrace stackTrace = new StackTrace(3); this.InternalLog(string.Format("[{0}:{1}] {2}\r\n{3}", new object[] { logType.ToString(), DateTime.Now.ToString(), string.Format(format, args), stackTrace.ToString() })); } else { this.InternalLog(string.Format("[{0}:{1}] {2}", logType.ToString(), DateTime.Now.ToString(), string.Format(format, args))); } if (this.original != null) { this.original.LogFormat(logType, context, format, args); } if (VRCLog.MessageLogged != null) { VRCLog.MessageLogged(string.Format(format, args), (!(context == null)) ? context.name : "null", logType); } }
// Token: 0x0600586D RID: 22637 RVA: 0x001E9F98 File Offset: 0x001E8398 private void Update() { if (UnityEngine.Debug.isDebugBuild && Input.GetKeyDown(KeyCode.U) && (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))) { VRCLog.EnableProfilerWithLogging(!VRCLog._profiler_logging_enabled); } VRCLog.profiler_enabled = Profiler.enabled; }
// Token: 0x0600587D RID: 22653 RVA: 0x001EA5CC File Offset: 0x001E89CC public void LogException(Exception exception, UnityEngine.Object context) { this.InternalLog(string.Format("[{0}:{1}] {2}\r\n{3}", new object[] { LogType.Exception.ToString(), DateTime.Now.ToString(), exception.Message, exception.StackTrace })); if (this.original != null) { this.original.LogException(exception, context); } if (VRCLog.MessageLogged != null) { VRCLog.MessageLogged(exception.Message, exception.StackTrace, LogType.Exception); } }
// Token: 0x0600586E RID: 22638 RVA: 0x001E9FF0 File Offset: 0x001E83F0 private void OnDestroy() { VRCLog.Instance = null; }