Exemplo n.º 1
0
    public static bool Handle_ServerLogging(eNetCmd cmd, UsCmd c)
    {
        UsLogPacket pkt = new UsLogPacket(c);

        string logTypeStr = "";

        switch (pkt.LogType)
        {
        case UsLogType.Error:
        case UsLogType.Exception:
        case UsLogType.Assert:
        case UsLogType.Warning:
            logTypeStr = string.Format("{1}", pkt.LogType);
            break;

        case UsLogType.Log:
        default:
            break;
        }

        string timeStr = string.Format("{0:0.00}({1})", pkt.RealtimeSinceStartup, pkt.SeqID);

        string ret = string.Format("{0} {1} <color=white>{2}</color>", timeStr, logTypeStr, pkt.Content);

        if (!string.IsNullOrEmpty(pkt.Callstack))
        {
            ret += string.Format("\n<color=gray>{0}</color>", pkt.Callstack);
        }

        Debug.Log(ret);

        return(true);
    }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        private bool Handle_ServerLogging(eNetCmd cmd, UsCmd c)
        {
            UsLogPacket pkt = new UsLogPacket(c);

            UsNetLogging.Print(pkt);
            return(true);
        }
Exemplo n.º 4
0
 private bool Handle_ServerLogging(eNetCmd cmd, UsCmd c)
 {
     UsLogPacket pkt = new UsLogPacket(c);
     UsNetLogging.Print(pkt);
     return true;
 }
Exemplo n.º 5
0
        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);
        }