public static void RegisterLogger(LoggerBase target) { _Log += target.Log; _LogWarning += target.LogWarning; _LogError += target.LogError; _LogException += target.LogException; }
public static void CleanLogger() { _Log = null; _LogWarning = null; _LogError = null; _LogException = null; }
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); */ }
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); */ }
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); }
public static void InitLogHandle(LogHandle handle) { logHandle = handle; if (clientHelper != null) { clientHelper.LogHandle = logHandle; } }
internal static bool Log(T obj, LogLevel level) { if (level < Logger.LogLevel) { return(true); } return(LogHandle?.Invoke(obj, level) ?? false); }
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 })); }
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); }
public TcpServerHelper(MessageInfoHandle msgHandle, LogHandle logHandle) : base(msgHandle, logHandle) { }
public TcpClientHelper(MessageInfoHandle msgHandle, LogHandle logHandle) : base(msgHandle, logHandle) { }
public TcpBase(MessageInfoHandle msgHandle, LogHandle logHandle) { this.msgHandle = msgHandle; this.logHandle = logHandle; }
public TcpClientHelper(MessageInfoHandle msgHandle, LogHandle logHandle) : base(msgHandle,logHandle) { }