prettylog icon indicating copy to clipboard operation
prettylog copied to clipboard

Enable multivalue keys

Open RaphaelVRossi opened this issue 4 years ago • 2 comments

Change config file to accept multivalue keys.

For example:

{
  "time": "2021-01-01"
}

or

{
  "ts": "2021-01-01"
}

will be readable if .prettylog.yml is set with:

timestamp:
  key: time, ts

This is my first pull request for hacktoberfest!

RaphaelVRossi avatar Oct 04 '21 22:10 RaphaelVRossi

Thanks for your interest in contributing! :)

What was the rationale behind this change? Prettylog was designed to operate on the output of a single app, and I don't really see how a single field (e.g.: timestamp) would be printed with different names.

I'd appreciate if you could elaborate on how you think this change would be useful.

mbenford avatar Oct 14 '21 17:10 mbenford

Thanks for your interest in contributing! :)

What was the rationale behind this change? Prettylog was designed to operate on the output of a single app, and I don't really see how a single field (e.g.: timestamp) would be printed with different names.

I'd appreciate if you could elaborate on how you think this change would be useful.

First things first, sorry for late reply.

At the time of this change, I was testing with three different output logs, before normalize it into one format.

So I did propose this change to make sense with that reality where I have a "default" configuration file for prettylog with my common field names, without need to think about timestamp or ts.

Thank you @mbenford !!

RaphaelVRossi avatar Feb 22 '22 00:02 RaphaelVRossi

Sorry for the very late response!

I guess I understand what you meant (multiple apps with different log formats). The way to go about it is to have a custom .prettylog.yml file in the app's folder. prettylog looks for a config file in the current directory, then one directory above and finally in the $HOME folder.

Happy Birthday, btw! 🎂

mbenford avatar Dec 19 '22 13:12 mbenford