## Log Happy ## ========= ## ## Little tool to extract expected information from log streams. import json, logging, ncurses, os, osproc, streams, strutils, threadpool import nre except toSeq import private/ncurses_ext from posix import signal type Expectation* = ref object label: string pattern: Regex expected, found: bool let expPattern = re"^-([eE])([^;]+);(.+)$" var msgChannel: Channel[string] proc exitErr(msg: string): void = stderr.writeLine "log_happy: " & msg quit(QuitFailure) proc readStream(stream: Stream): void = var line = TaintedString"" try: while stream.readLine(line): msgChannel.send(line) except: discard "" when isMainModule: var cmdProc: Process try: let usage = """ Usage: log_happy [options] log_happy [options] log_happy [options] -- Options: -e