## Log Happy ## ========= ## ## Little tool to extract expected information from log streams. import json, logging, ncurses, os, osproc, sequtils, 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 var inStream: Stream var outFile: File try: let VERSION = "0.1.0" let usage = """ Usage: log_happy [options] log_happy [options] log_happy [options] -- Options: -v Print version information and exit. -e