usingSystem;usingSystem.IO;namespaceUnityEngine
{///
///系统日志模块///
public classDebugger
{public static bool EnableLog; //是否启用日志,仅可控制普通级别的日志的启用与关闭,LogError和LogWarn都是始终启用的。
public static bool EnableTime = true;public static bool EnableSave = false; //是否允许保存日志,即把日志写入到文件中
public static bool EnableStack = false;public static string LogFileDir = Application.persistentDataPath + "/DebuggerLog/";public static string LogFileName = "";public static string Prefix = ">"; //用于与Unity默认的系统日志做区分。本日志系统输出的日志头部都会带上这个标记。
public static StreamWriter LogFileWriter = null;public static boolUseUnityEngine;private static string GetLogText(string tag, stringmessage)
{string str = "";if(EnableTime)
{
str= DateTime.Now.ToString("HH:mm:ss.fff") + " ";
}return (