예제 #1
0
    public static void Log(string log, LogChannel channel, bool includeUp, LogType logType)
    {
        if (logToConsole)
        {
            if ((includeUp && ((int)LogManager.channel >= (int)channel)) || LogManager.channel == channel)
            {
                if (logType == LogType.Log)
                {
                    Debug.Log(log);
                }
                else if (logType == LogType.Error)
                {
                    Debug.LogError(log);
                }
                else
                {
                    Debug.LogWarning(log);
                }
            }
        }

        if (writeToText)
        {
            if (includeUp && ((int)LogManager.channel >= (int)channel))
            {
                TextToFile.WriteToFile(log, debugLog);
            }
            else if (LogManager.channel == channel)
            {
                TextToFile.WriteToFile(log, debugLog);
            }
        }
    }
예제 #2
0
    public static void Log(string log, LogChannel channel, bool includeUp)
    {
        if (logToConsole)
        {
            if (includeUp && ((int)LogManager.channel >= (int)channel))
            {
                Debug.Log(log);
            }
            else if (LogManager.channel == channel)
            {
                Debug.Log(log);
            }
        }

        if (writeToText)
        {
            if (includeUp && ((int)LogManager.channel >= (int)channel))
            {
                TextToFile.WriteToFile(log, debugLog);
            }
            else if (LogManager.channel == channel)
            {
                TextToFile.WriteToFile(log, debugLog);
            }
        }
    }
예제 #3
0
    public static void Log(string log, LogChannel channel, bool includeUp, LogType logType, bool controlByInside, bool isWriteToText, bool isLogToConsole, LogColor logColor = LogColor.none)
    {
        if (controlByInside)
        {
            isWriteToText  = writeToText;
            isLogToConsole = logToConsole;
            includeUp      = LogManager.includeUp;
        }


        if (isLogToConsole)
        {
            if ((includeUp && ((int)LogManager.channel >= (int)channel)) || LogManager.channel == channel)
            {
                if (logColor != LogColor.none)
                {
                    log = string.Format(colorMap [logColor], log);
                }
                if (logType == LogType.Log)
                {
                    Debug.Log(log);
                }
                else if (logType == LogType.Error)
                {
                    Debug.LogError(log);
                }
                else
                {
                    Debug.LogWarning(log);
                }
            }
        }

        if (writeToText)
        {
            log = string.Format("{0}. {1}", lineNum, log);
            lineNum++;
            if (includeUp && ((int)LogManager.channel >= (int)channel))
            {
                TextToFile.WriteToFile(log, debugLog);
            }
            else if (LogManager.channel == channel)
            {
                TextToFile.WriteToFile(log, debugLog);
            }
        }
    }