Beispiel #1
0
 private void OnLogToConsolePage(LogLine log)
 {
     if (memoryLog != null)
     {
         memoryLog.Add(log);
         ++showTagsNum[(int)log.tag];
     }
 }
Beispiel #2
0
    private static void LogImpl(Tag tag, string msg, params object[] args)
    {
        if (tag < logPriority)
        {
            return;
        }

        DateTime now = DateTime.Now;

        string formated = msg == null ? "null" : msg;

        if (args != null && args.Length > 0)
        {
            for (int i = 0; i < args.Length; ++i)
            {
                if (args[i] == null)
                {
                    args[i] = "null";
                }
            }
            formated = string.Format(formated, args);
        }

        LogLine logLine = new LogLine {
            time = now, msg = formated, tag = tag
        };

        if (memoryLog != null)
        {
            memoryLog.Add(logLine);
        }

        if (OnLogEvent != null)
        {
            OnLogEvent(logLine);
        }
    }