EventLogWriter.cs 688 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Core.RT.Log;
  6. namespace Aitex.Core.RT.Event
  7. {
  8. class EventLogWriter
  9. {
  10. public void WriteEvent(EventItem ev)
  11. {
  12. if (ev.Description == null)
  13. ev.Description = "";
  14. if (ev.Level == EventLevel.Alarm)
  15. LOG.Error(ev.Description.Replace("'", "''"));
  16. else if (ev.Level == EventLevel.Warning)
  17. {
  18. LOG.Warning(ev.Description.Replace("'", "''"));
  19. }
  20. else
  21. {
  22. LOG.Info(ev.Description.Replace("'", "''"));
  23. }
  24. }
  25. }
  26. }