public void Write(string writeFileData, LogType type, DebugColoyType colorType = DebugColoyType.White, int size = 13) { if (m_CurrLogCount >= m_LogMaxCapacity) { m_LogPath = ReporterPath + "//" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + ".txt"; m_LogMaxCapacity = 0; } m_CurrLogCount++; if (!string.IsNullOrEmpty(writeFileData)) { writeFileData = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss:fff") + "|" + type.ToString() + "|" + writeFileData + "\r\n"; AppendDataToFile(writeFileData); } #if UNITY_EDITOR if (type == LogType.Error || type == LogType.Exception) { GameEntry.Debug.LogError(writeFileData, size); } else if (type == LogType.Warning) { GameEntry.Debug.LogWarning(writeFileData, size); } else { GameEntry.Debug.Log(writeFileData, colorType, size); } #endif }
public void Log(object message, DebugColoyType colorType = DebugColoyType.White, int size = 10) { UnityEngine.Debug.Log($"<size={size}><color=#{m_ColorTypeDic[colorType]}>{message}</color></size>"); }