## Log Happy ## ========= ## ## Little tool to extract expected information from log streams. import json, ncurses, os, osproc, sequtils, streams, strutils, threadpool import nre except toSeq import private/ncurses_ext 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 var inStream: Stream var outFile: File try: let VERSION = "0.2.1" let usage = """ Usage: log_happy [options] log_happy [options] log_happy [options] -- Options: -h --help Print this usage information and exit. -v --version Print version information and exit. -e