コード例 #1
0
            private string FormatLogEntry(MVCommon.LogEntry logEntry)
            {
                StringBuilder stringBuilder = new StringBuilder();

                if (m_mvxLoggerSink.outputTime)
                {
                    stringBuilder.Append(TimestampToString(logEntry.Timestamp, true).NetString).Append("|");
                }
                stringBuilder.Append(logEntry.ThreadID).Append("|");
                stringBuilder.Append(LogLevelToString(logEntry.Level, true)).Append("|");
                stringBuilder.Append(logEntry.Tag).Append("|");
                stringBuilder.Append(logEntry.Message);
                return(stringBuilder.ToString());
            }
コード例 #2
0
            protected override void HandleLogEntry(MVCommon.LogEntry logEntry)
            {
                switch (logEntry.Level)
                {
                case MVCommon.LogLevel.LL_CRITICAL:
                case MVCommon.LogLevel.LL_ERROR:
                    Debug.LogErrorFormat("Mvx2: {0}", FormatLogEntry(logEntry));
                    break;

                case MVCommon.LogLevel.LL_WARNING:
                    Debug.LogWarningFormat("Mvx2: {0}", FormatLogEntry(logEntry));
                    break;

                case MVCommon.LogLevel.LL_DEBUG:
                case MVCommon.LogLevel.LL_INFO:
                case MVCommon.LogLevel.LL_VERBOSE:
                    Debug.LogFormat("Mvx2: {0}", FormatLogEntry(logEntry));
                    break;

                default:
                    Debug.LogFormat("Mvx2: Unknown log level '{0}'", logEntry.Level.ToString());
                    break;
                }
            }