Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.71 KB | None | 0 0
  1. proc logger() {.async.} =
  2.   while true:
  3.     try:
  4.       let line = file.read_line();
  5.       let words = line.split(' ');
  6.       case words[0]
  7.         of "REQ":
  8.           display("Request", words[1..<words.len()].join(" "), Success, HighPriority)
  9.         of "INF":
  10.           display("Info", words[2..<words.len()].join(" "), Message, words[1].to_priority())
  11.         of "ERR":
  12.           display("Error", words[2..<words.len()].join(" "), Error, words[1].to_priority())
  13.         of "WRN":
  14.           display("Warning", words[2..<words.len()].join(" "), Warning, words[1].to_priority())
  15.         of "FTL":
  16.           display("Fatal", words[2..<words.len()].join(" "), Error, words[1].to_priority())
  17.     except:
  18.       sleep 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement