Skip to content

Plain text log tail feature request #16

@kensmith

Description

@kensmith

Just started using Render today and I'm a fan. Super easy to set up. And, I love that your cli is written in go with all of its charmbraclety goodness. I would love to be able to just tail the raw logs to the console so that I can grep, parse, colorize, etc. using my own scripts. For example, in dev, I use this jq monstrosity to colorize the logs:

#!/usr/bin/env bash

highlight=
if [[ "$1" != "" ]]
then
  highlight="$1"
fi

jq --unbuffered -r -R -M 'fromjson? | .' \
  | awk -v highlight="$highlight" 'BEGIN {IGNORECASE=1} { \
      if ($0 ~ /msg/) { \
        line = $0; \
        if (highlight != "") { \
          gsub(highlight,"\033[1;33m" highlight "\033[0m", line); \
        } \
        print "\033[1;32m" line "\033[0m"; \
      } else { \
        line = $0; \
        gsub(/INFO/,"\033[1;32mINFO\033[0m", line); \
        gsub(/WARN/,"\033[1;33mWARN\033[0m", line); \
        gsub(/ERROR/,"\033[1;31mERROR\033[0m", line); \
        if (highlight != "") { \
          gsub(highlight,"\033[1;33m" highlight "\033[0m", line); \
        } \
        print line \
      } \
    }'

It'd be dreamy if I could do something like

render logs -f | ./bin/pretty-jq

and get the familiar log view that I enjoy when running locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions