private bool Handle_ServerLogging(eNetCmd cmd, UsCmd c) { UsLogPacket pkt = new UsLogPacket(c); UsNetLogging.Print(pkt); return true; }
public static void Print(UsLogPacket packet) { if (IsLogFiltered(packet.LogType)) return; string logTypeStr = ""; switch (packet.LogType) { case UsLogType.Error: case UsLogType.Exception: case UsLogType.Assert: case UsLogType.Warning: logTypeStr = string.Format("[b][color={0}]({1})[/color][/b]", s_type2color[packet.LogType], packet.LogType); break; case UsLogType.Log: default: break; } string timeStr = string.Format("[color={0}]{1:0.00}({2})[/color]", s_gameLogTimeColor, packet.RealtimeSinceStartup, packet.SeqID); string ret = string.Format("{0} {1} {2}", timeStr, logTypeStr, packet.Content); if (!IsCallstackFiltered(packet.LogType) && !string.IsNullOrEmpty(packet.Callstack)) { ret += string.Format("\n[color=DarkGray]{0}[/color]", packet.Callstack); } UsLogging.Printf(LogWndOpt.NetLog, ret); }