Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc logger() {.async.} =
- while true:
- try:
- let line = file.read_line();
- let words = line.split(' ');
- case words[0]
- of "REQ":
- display("Request", words[1..<words.len()].join(" "), Success, HighPriority)
- of "INF":
- display("Info", words[2..<words.len()].join(" "), Message, words[1].to_priority())
- of "ERR":
- display("Error", words[2..<words.len()].join(" "), Error, words[1].to_priority())
- of "WRN":
- display("Warning", words[2..<words.len()].join(" "), Warning, words[1].to_priority())
- of "FTL":
- display("Fatal", words[2..<words.len()].join(" "), Error, words[1].to_priority())
- except:
- sleep 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement