hedhyw / json-log-viewer

Interactive viewer for JSON logs.
MIT License
77 stars 7 forks source link

feat: Multiple configurations #61

Closed RayPS closed 3 months ago

RayPS commented 4 months ago

If I understand correctly, only a single configuration file can be stored in $PWD or $HOME currently. The only way to maintain and use different configurations is to store them separately in different directory and switch them by changing PWD. Not to mention having a different configuration in the same directory.

I hope there is an option to let us specify the path of configuration file and always having the higher priority than $PWD and $HOME. So in concept:

jlv access-log.json --conf view2.jlv.jsonc

Or maybe having a different configuration in a single file? In case of not breaking current format:

{
    fields: [], // default
    another_fields: [],
    different_fields: [],
    more_fields: [],
    blahblah: []
}
hedhyw commented 4 months ago

Hello, thanks for the feature request!

It's a good idea with a config flag!

We can pass it to https://github.com/hedhyw/json-log-viewer/blob/d1b9829422eb783b62e405061ea73423b61086b5/cmd/jlv/main.go#L41