public IEnumerable <IEventLog> EnumerateClientLog(uint clID) { Dbg.Assert(IsLoggerStarted(clID)); lock (m_clientsloggers) { ClientEventLogger logger = m_clientsloggers.Find(l => l.ClientID == clID); return(logger?.Logs); } }
public void StartLogger(uint clID) { lock (m_clientsloggers) { if (m_clientsloggers.Find(l => l.ClientID == clID) == null) { var logger = new ClientEventLogger(clID); m_clientsloggers.Add(logger); } } }
public void CloseLogger(uint clID) { lock (m_clientsloggers) { ClientEventLogger logger = m_clientsloggers.Find(l => l.ClientID == clID); if (logger != null) { m_clientsloggers.Remove(logger); logger.Dispose(); } } }
public void LogClientError(uint clID, string txt, DateTime tm) { Dbg.Assert(IsLoggerStarted(clID) == true); lock (m_clientsloggers) { ClientEventLogger logger = m_clientsloggers.Find(l => l.ClientID == clID); IEventLog log = logger?.LogEvent(txt, tm, EventType_t.Error); if (log != null) { ClientLogAdded?.Invoke(clID, log); } } }