Live data from Hacker News

Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

github.com

11–20 of 81 posts

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#11

> This tool has been generated entirely with ChatGPT and hence it is also a demonstration of how useful products can be developed with collaborative reiteration with GPTs. All you need to know.

I was going to ask about the strange combination of package.json and inlined cdn js dependencies (especially strange because it's a local server) Suppose that answers it.

Haha yeah, I wanted to frame this as a single file tool, and hence all the quick wins. But later moved the react app into a separate file because I was not getting the syntax highlights and all.

Definitely this can be made better with proper packaging and tooling! As I mentioned, more than the idea, implementation was an experiment on the ability of collaborative iterations with GPTs- it was fun!

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#13
post #6

Very tempted! Installation instructions?

`npx` is a tool that ships alongside `npm` (alongside `node`) that either finds a local installation or performs a just-in-time download, and then runs the default "bin" entrypoint for the package.

Newer versions of `npx` (last few years) will prompt the user before installing a package. Older versions did not. Note that installing the package can run arbitrary scripts as a side effect with at least the level of permission of the current user, so there is implicit trust required of the author, and the authors of all transitive dependencies.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#14
Is there a benefit over

    command | vim -
?

I love doing that, because then I get all the power of Vim to look at the output. Search, regex search, sorting, bookmarks, counting, macros ...

I started to write output that is indented, so I can use Vim's folding to comfortably look at complex data.

For example if you have entries like this:

    2023-04-12 17:22 Sighted and UFO
        Location: 27.1742424 12.137234
        Temperature: 24°C
        Observer: Joe
        Actually it turned out to be a dove.
And you press zM in Vim, they all turn into:

    2023-04-12 17:22 Sighted and UFO
        + 4 lines
So you have a nice overview and can open individual entries by putting the curser on them and hit zo.

And while folded, you still have all the power of Vim to search within them. Regex search. Count by any measure you like etc etc. Actually, you can do anything, as Vim allows you to execute arbitrary vim commands, vim macros or shell commands on your buffer.

Wanna know how many doves typically get mistaken for UFOs around New York grouped by month? Write a script for it and it will be forever at your fingertips.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#16

> This tool has been generated entirely with ChatGPT and hence it is also a demonstration of how useful products can be developed with collaborative reiteration with GPTs. All you need to know.

> All you need to know.

For those of us not in the know, what does that mean?

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#17
post #14

Is there a benefit over command | vim - ? I love doing that, because then I get all the power of Vim to look at the output. Search, regex search, sorting, bookmarks, counting, macros ... I started to write output that is indented, so I can use Vim's folding to comfortably look at complex data. For example if you have entries like this: 2023-04-12 17:22 Sighted and UFO Location: 27.1742424 12.137234 Temperature: 24°C…

I think this is more designed for streamed output rather than viewing files. Vim doesn't seem to support that, in fact it just says "Vim: Reading from stdin..." forever.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#20
post #14

Is there a benefit over command | vim - ? I love doing that, because then I get all the power of Vim to look at the output. Search, regex search, sorting, bookmarks, counting, macros ... I started to write output that is indented, so I can use Vim's folding to comfortably look at complex data. For example if you have entries like this: 2023-04-12 17:22 Sighted and UFO Location: 27.1742424 12.137234 Temperature: 24°C…

I think this is more designed for streamed output rather than viewing files. Vim doesn't seem to support that, in fact it just says "Vim: Reading from stdin..." forever.

Hmm.. I guess you could write a little script (2 lines?), let's call it "vimlive" which reads from stdin, streams to a temp file and opens that temp file in vim.

Then with:

    command | vimlive
You get vim with the current state of the data and you can update it with :e
Post reply on HN