Ejemplo n.º 1
0
 internal static void SetLog(SocketLogType type, Object sender, string message)
 {
     if (OnLog != null)
     {
         OnLog(type, sender, message);
     }
 }
Ejemplo n.º 2
0
        static void SocketLogMgt_OnLog(SocketLogType type, object sender, string message)
        {
            StringBuilder sb = new StringBuilder();

            switch (type)
            {
            default:
            case SocketLogType.Debug:
            {
                if (sender == null)
                {
                    sb.Append("[SOCKET_CLIENT] ");
                }
                else
                {
                    sb.Append("[SOCKET_SERVER] ");
                }
                break;
            }

            case SocketLogType.Error:
            {
                sb.Append("[SOCKET_ERROR] ");
                break;
            }

            case SocketLogType.Warning:
            {
                sb.Append("[SOCKET_WARNING] ");
                break;
            }
            }
            if (message == null)
            {
                sb.Append("[NULL]");
            }
            else
            {
                sb.Append(message);
            }
            Program.Log.Write(sb.ToString());
        }
Ejemplo n.º 3
0
 internal static void SetLog(SocketLogType type, string message)
 {
     SetLog(type, null, message);
 }