https://github.com/3noch/nestify
A command-line tool that indents each entry in a log file based on how "nested" it is.
https://github.com/3noch/nestify
Last synced: 8 months ago
JSON representation
A command-line tool that indents each entry in a log file based on how "nested" it is.
- Host: GitHub
- URL: https://github.com/3noch/nestify
- Owner: 3noch
- License: mit
- Created: 2014-01-28T13:45:15.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-02-17T21:34:37.000Z (over 11 years ago)
- Last Synced: 2024-12-27T04:08:33.770Z (over 1 year ago)
- Language: Haskell
- Size: 129 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nestify
=======
A command-line tool that indents each entry in a log file based on how "nested" it is.
Usage
-----
Use `nestify --help` for details about arguments. All input is through `stdin`.
Currently, a nestifiable log file must have at least two columns. The last column will be indented
and the penultimate column will be used as the name of a scope. Certain keywords are detected in
the last column to determine if a new scope is being added or removed from the stack. The keywords
for adding a new scope are "Enter" and "Begin". The keywords for ending a scope are "Exit" and "End".
For example, if `test.log` contains this
```
func1|Doing something.
func2|Enter
func2|Doing something else.
func2|Exit
func1|More stuff.
func3|Begin
func4|Begin
func5|Begin
func5|Ok, we're done.
func5|End
func4|Exit
func3|End
func1|Shutdown...
```
then piping `test.log` through `nestify` produces indented output:
```
$ cat test.log | nestify -d "|"
func1|Doing something.
func2|Enter
func2| Doing something else.
func2|Exit
func1|More stuff.
func3|Begin
func4| Begin
func5| Begin
func5| Ok, we're done.
func5| End
func4| Exit
func3|End
func1|Shutdown...
```
Building
--------
You must have
* [Glasgow Haskell Compiler](http://www.haskell.org/ghc/)
* [Cabal](http://www.haskell.org/cabal/) (which comes with the [Haskell Platform](http://www.haskell.org/platform/))
Then you can
```bash
$ cd nestify
$ cabal install
```
License
-------
Copyright © Covenant Eyes 2014
This package is licensed under the [MIT license](http://opensource.org/licenses/mit-license.php)
(see `LICENSE`).