コード例 #1
0
ファイル: CLog.cs プロジェクト: mrjonyk/WarriorRoad3D
    public static void LogError(string text, ELogMode mode = ELogMode.Error)
    {
#if SIMPLE_DEBUG
        Debug.LogError(text);
        var callerName = GetCallerName() + " ";
        CLogGUI.Instance.AddErrorMessage(callerName + text);
#endif
    }
コード例 #2
0
ファイル: CLog.cs プロジェクト: co-chi-tam/Unity-Ultilities
    public static void LogError(string text, ELogMode mode = ELogMode.Error)
    {
#if UNITY_EDITOR
        Debug.LogError(text);
#endif
        var callerName = GetCallerName() + " ";
        CLogGUI.Instance.AddErrorMessage(callerName + text);
    }
コード例 #3
0
ファイル: CLog.cs プロジェクト: mrjonyk/WarriorRoad3D
    public static void LogWarning(string text, ELogMode mode = ELogMode.Warning)
    {
#if SIMPLE_DEBUG
        Debug.LogWarning(text);
        var callerName = GetCallerName() + " ";
        CLogGUI.Instance.AddWarningMessage(callerName + text);
#endif
    }
コード例 #4
0
ファイル: CLog.cs プロジェクト: co-chi-tam/Unity-Ultilities
    public static void LogWarning(string text, ELogMode mode = ELogMode.Warning)
    {
#if UNITY_EDITOR
        Debug.LogWarning(text);
#endif
        var callerName = GetCallerName() + " ";
        CLogGUI.Instance.AddWarningMessage(callerName + text);
    }
コード例 #5
0
        public virtual bool Init(string sDir, string sFileName,
                                 ELogMode eLogMode, int nOutputMask, string sPrefix, int nLogLevel, bool bUseLock)
        {
            m_bUseLock    = bUseLock;
            m_sPrefix     = sPrefix;
            m_nLogLevel   = nLogLevel;
            m_nOutputMask = nOutputMask;

            return(true);
        }
コード例 #6
0
        public static LPLogger CreateLogger(ELogType eLogType, string sDir, string sFileName,
                                            ELogMode eLogMode, int nOutputMask, string sPrefix, int nLogLevel, bool bUseLock)
        {
            bool     bResult = false;
            LPLogger lg      = null;

            switch (eLogType)
            {
            case ELogType.File:
            {
                lg = new LPFileLogger();
                if (PTF_ERROR(lg != null))
                {
                    goto Exit0;
                }

                bResult = lg.Init(sDir, sFileName, eLogMode, nOutputMask, sPrefix, nLogLevel, bUseLock);
                if (PTF_ERROR(bResult))
                {
                    goto Exit0;
                }
            }
            break;

            case ELogType.Invalid:
            case ELogType.Net:
            case ELogType.Total:
            default:
                if (PTF_ERROR(false))
                {
                    goto Exit0;
                }
                break;
            }

            return(lg);

Exit0:

            if (lg != null)
            {
                PTF_ERROR(lg.UnInit());
                lg = null;
            }
            return(null);
        }
コード例 #7
0
ファイル: LPFileLogger.cs プロジェクト: zeroweek/ProgramGroup
        public override bool Init(string sDir, string sFileName,
                                  ELogMode eLogMode, int nOutputMask, string sPrefix, int nLogLevel, bool bUseLock)
        {
            bool          bResult = false;
            DirectoryInfo dirInfo = null;

            bResult = base.Init(sDir, sFileName, eLogMode, nOutputMask, sPrefix, nLogLevel, bUseLock);
            if (PTF_ERROR(bResult))
            {
                goto Exit0;
            }

            if (PTF_ERROR(m_bInit == false))
            {
                goto Exit0;
            }

            if (PTF_ERROR(m_oLoopBuf == null))
            {
                goto Exit0;
            }
            m_oLoopBuf = new LPLoopBuf();
            if (PTF_ERROR(m_oLoopBuf != null))
            {
                goto Exit0;
            }

            bResult = m_oLoopBuf.Init(CNT_LOG_BUF_SIZE);
            if (PTF_ERROR(bResult))
            {
                goto Exit0;
            }

            m_eLogMode = eLogMode;
            if (PTF_ERROR(m_eLogMode > ELogMode.Invalid))
            {
                goto Exit0;
            }
            if (PTF_ERROR(m_eLogMode < ELogMode.Total))
            {
                goto Exit0;
            }

            m_sDir      = sDir;
            m_sFileName = sFileName;
            if (PTF_ERROR(m_eLogMode > ELogMode.Invalid))
            {
                goto Exit0;
            }
            dirInfo = Directory.CreateDirectory(m_sDir);
            if (PTF_ERROR(dirInfo != null))
            {
                goto Exit0;
            }

            _UpdateFilePointer();
            if (PTF_ERROR(m_oFile != null))
            {
                goto Exit0;
            }

            m_bRun    = true;
            m_oThread = new Thread(_ThreadProc);
            m_oThread.Start(this);

            m_bInit = true;

            return(true);

Exit0:
            return(false);
        }
コード例 #8
0
 public static void LogDebug(string text, ELogMode mode = ELogMode.None)
 {
     Debug.Log(text);
 }