Exemple #1
0
    public static void Log(GameLogLevel level,GameLogType type,string msg)
    {
        /*判断该级别的log是否要被打印*/

        mySw.WriteLine(MTimer.GetTime());
        string msgType=null; 
        
        switch(level){
            case GameLogLevel.DEBUG:
                if (!_Debug)
                    return ;
                msgType="Debug  ";
                break;
            case GameLogLevel.ERROR:
                if (!_Error)
                    return;
                msgType = "Error  ";
                break;
            case GameLogLevel.FATAL:
                if (!_Fatal)
                    return;
                msgType = "Fatal  ";
                break;
            case GameLogLevel.INFO:
                if (!_Info)
                    return;
                msgType = "Info  ";
                break;
            case GameLogLevel.WARN:
                if (!_Warn)
                    return;
                msgType = "Warn  ";
                break;
        
        
        }
        switch (type) { 
            case GameLogType.GameLog:
                msgType += "GameLog:";
                break;
            case GameLogType.LanuchLog:
                msgType += "LanuchLog:";
                break;
            case GameLogType.RegitLog:
                msgType += "RegitLog:";
                break;
            case GameLogType.ResultLog:
                msgType +="ResultLog:";
                break;
            case GameLogType.RoomLog:
                msgType +="RoomLog:";
                break;
        }
        mySw.WriteLine(msgType + msg);
        mySw.Flush();

        if (isPrint) {
            Debug.Log(msgType + msg);
        }

    }
Exemple #2
0
 public static void Write(GameLogLevel type, string message, params object[] args)
 {
     Instance.Write(LogType.GameLog, type, message, args);
 }