EventLogWriter.cs 610 B

1234567891011121314151617181920212223242526
  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.Level == EventLevel.Alarm)
  13. LOG.Error(ev.Description.Replace("'", "''"));
  14. else if (ev.Level == EventLevel.Warning)
  15. {
  16. LOG.Warning(ev.Description.Replace("'", "''"));
  17. }
  18. else
  19. {
  20. LOG.Info(ev.Description.Replace("'", "''"));
  21. }
  22. }
  23. }
  24. }