Пример #1
0
 public static void RegisterLogger(LoggerBase target)
 {
     _Log          += target.Log;
     _LogWarning   += target.LogWarning;
     _LogError     += target.LogError;
     _LogException += target.LogException;
 }
Пример #2
0
 public static void CleanLogger()
 {
     _Log          = null;
     _LogWarning   = null;
     _LogError     = null;
     _LogException = null;
 }
Пример #3
0
 public TcpWatcherForm(MessageInfoHandle msgHandle)
 {
     InitializeComponent();
     FormHelper.InitHabitToForm(this);
     if (msgHandle == null)
     {
         this.msgHandle = new MessageInfoHandle(ParseMessage);
     }
     else
     {
         this.msgHandle = msgHandle;
     }
     LogHandle log = new LogHandle(Log);
     tcpServerHelper = new TcpServerHelper(this.msgHandle, log);
     this.tcpServerHelper.Parent = this;
     this.tcpServerHelper.ClientClose += new TcpEvent(tcpServerHelper_ClientClose);
     this.tcpServerHelper.ClientConn += new TcpEvent(tcpServerHelper_ClientConn);
     /*
     �����Ҫ���ͻ��˷�����Ϣ��ʹ�����
     OrgInfo org = new OrgInfo();
     org.FullName = "XX��֯";
     org.NickName = "xx";
     org.Telephone = "tel";
     org.Url = "url";
     MessageFactory.InitOrg(org);
      */
 }
Пример #4
0
        public TcpWatcherForm(MessageInfoHandle msgHandle)
        {
            InitializeComponent();
            FormHelper.InitHabitToForm(this);
            if (msgHandle == null)
            {
                this.msgHandle = new MessageInfoHandle(ParseMessage);
            }
            else
            {
                this.msgHandle = msgHandle;
            }
            LogHandle log = new LogHandle(Log);

            tcpServerHelper                   = new TcpServerHelper(this.msgHandle, log);
            this.tcpServerHelper.Parent       = this;
            this.tcpServerHelper.ClientClose += new TcpEvent(tcpServerHelper_ClientClose);
            this.tcpServerHelper.ClientConn  += new TcpEvent(tcpServerHelper_ClientConn);

            /*
             * 如果需要给客户端发送消息则使用这个
             * OrgInfo org = new OrgInfo();
             * org.FullName = "XX组织";
             * org.NickName = "xx";
             * org.Telephone = "tel";
             * org.Url = "url";
             * MessageFactory.InitOrg(org);
             */
        }
Пример #5
0
 public void Test()
 {
     logHandle = FindObjectOfType <LogHandle>();
     M.WriteIntPtr(lastException, INTPTR.Zero);
     JSDLL.JSEvaluateScript(gtx, JSDLL.JSStringCreateWithUTF8CString("a = new UnityEngine.GameObject('a123');"), INTPTR.Zero, INTPTR.Zero, 0, lastException);
     PrintLastException(gtx);
 }
Пример #6
0
 public static void InitLogHandle(LogHandle handle)
 {
     logHandle = handle;
     if (clientHelper != null)
     {
         clientHelper.LogHandle = logHandle;
     }
 }
Пример #7
0
 internal static bool Log(T obj, LogLevel level)
 {
     if (level < Logger.LogLevel)
     {
         return(true);
     }
     return(LogHandle?.Invoke(obj, level) ?? false);
 }
Пример #8
0
 public static void InitLogHandle(LogHandle handle)
 {
     logHandle = handle;
     if (clientHelper != null)
     {
         clientHelper.LogHandle = logHandle;
     }
 }
Пример #9
0
        public ActionResult Test()
        {
            LogHandle Logger = new LogHandle(typeof(OrderController));

            //bool b = await t_MySql_OrderService.InsertList(new List<KYOMS.Core20.Entity.MySqlDB.T_MySql_Order>
            //    {
            //        new KYOMS.Core20.Entity.MySqlDB.T_MySql_Order(){ C1="", C2="", C3="", CREATE_BY="11", CREATE_TIME=DateTime.Now, IS_SYNC_SUCCESS=1, MSG_CONTENT="{\"data\":\"dsss\"}", MSG_TYPE="JSON", ORDER_SOURCE="TAOBAO", OUTSYS_BILL_CODE="111111", OUTSYS_ORDER_NO="222222", REMARK="" },
            //        new KYOMS.Core20.Entity.MySqlDB.T_MySql_Order(){ C1="", C2="", C3="", CREATE_BY="22", CREATE_TIME=DateTime.Now, IS_SYNC_SUCCESS=1, MSG_CONTENT="{\"data\":\"dsss\"}", MSG_TYPE="JSON", ORDER_SOURCE="TAOBAO", OUTSYS_BILL_CODE="222222", OUTSYS_ORDER_NO="333333", REMARK="" },
            //        new KYOMS.Core20.Entity.MySqlDB.T_MySql_Order(){ C1="", C2="", C3="", CREATE_BY="33", CREATE_TIME=DateTime.Now, IS_SYNC_SUCCESS=1, MSG_CONTENT="{\"data\":\"dsss\"}", MSG_TYPE="JSON", ORDER_SOURCE="TAOBAO", OUTSYS_BILL_CODE="333333", OUTSYS_ORDER_NO="444444", REMARK="" }
            //    });
            //    t_MySql_OrderService.Logger.Set(b.ToString(), LogHandle.LogerType.Info);

            "2222222".WriteToLog();
            return(Json(new { msg = true }));
        }
Пример #10
0
        public TcpIpTestForm()
        {
            InitializeComponent();
            MessageInfoHandle handle = new MessageInfoHandle(ParseMessage);
            LogHandle         log    = new LogHandle(Log);

            tcpClientHelper             = new TcpClientHelper(handle, log);
            tcpServerHelper             = new TcpServerHelper(handle, log);
            this.tcpServerHelper.Parent = this;
            this.tcpClientHelper.Parent = this;
            OrgInfo org = new OrgInfo();

            org.FullName  = "XX×éÖ¯";
            org.NickName  = "Ì©´ï¼ÝУ";
            org.Telephone = "tel";
            org.Url       = "url";
            MessageFactory.InitOrg(org);
        }
Пример #11
0
 public TcpServerHelper(MessageInfoHandle msgHandle, LogHandle logHandle)
     : base(msgHandle, logHandle)
 {
 }
Пример #12
0
 public TcpClientHelper(MessageInfoHandle msgHandle, LogHandle logHandle) : base(msgHandle, logHandle)
 {
 }
Пример #13
0
 public TcpBase(MessageInfoHandle msgHandle, LogHandle logHandle)
 {
     this.msgHandle = msgHandle;
     this.logHandle = logHandle;
 }
Пример #14
0
 public TcpClientHelper(MessageInfoHandle msgHandle, LogHandle logHandle)
     : base(msgHandle,logHandle)
 {
 }
Пример #15
0
 public TcpBase(MessageInfoHandle msgHandle, LogHandle logHandle)
 {
     this.msgHandle = msgHandle;
     this.logHandle = logHandle;
 }
Пример #16
0
 public TcpServerHelper(MessageInfoHandle msgHandle, LogHandle logHandle)
     : base(msgHandle, logHandle)
 {
 }