/// <summary> /// /// </summary> /// <param name="l"></param> /// <param name="msg"></param> /// <returns></returns> protected string Formatted(TLogLevel l, string msg) { DateTime dt = DateTime.Now; string s = string.Format("{0} [PID({3}), ALC({4}), AVL({5})] {1}: {2}", l.ToString(), dt.ToString("yyyy/MM/dd HH:mm:ss.fff"), msg, System.Threading.Thread.CurrentThread.ManagedThreadId, GetRomCommittedMB(), GetRomAvaliableMB()); return(s); }
// log public int LogWriteLn(string aLine, TLogLevel aLevel) { var Payload = new TByteBuffer(); if (!IsPublished && connection.AutoPublish) Publish(); if (IsPublished) { Payload.Prepare((Int32) 0); // client id filled in by hub Payload.Prepare(aLine); Payload.Prepare((Int32) aLevel); Payload.PrepareApply(); Payload.QWrite((Int32) 0); // client id filled in by hub Payload.QWrite(aLine); Payload.QWrite((Int32) aLevel); return SignalEvent(TEventKind.ekLogWriteLn, Payload.Buffer); } else return TConnection.iceNotEventPublished; }