invenia / Memento.jl

A flexible logging library for Julia
https://invenia.github.io/Memento.jl/latest
Other
88 stars 14 forks source link

Add ability to tweak display of fields in formatted output #93

Open iamed2 opened 6 years ago

iamed2 commented 6 years ago

Ideas:

rofinn commented 4 years ago

My understanding is that this would mean that we should rewrite the formatter to use Formatting.jl.

rofinn commented 4 years ago

After looking into Formatting.jl it seems like this package won't fit our requirements out of the box, so I'm not going to include this in our 1.0 release. Specifically, we'd need to add support for named arguments to format/printfmt.

ScottPJones commented 4 years ago

Have you looked at Format? It is based off of Formatting.jl (there was a period where Formatting.jl was still in a personal repo, and was not getting maintained much, so I ended up forking it and using it as the bases of Format.jl, which has diverged somewhat, with the addition of a default formatting (based off a PR to Formatting.jl by Tom Breloff. I'd be happy to look at adding any capabilities that you'd need for use by Memento, also.

rofinn commented 4 years ago

I have not, but looking at the README the primary feature needed doesn't exist yet. Specifically, the README states that:

It hasn't supported named arguments or fields extraction yet

I think if it added support for named arguments then our format strings (e.g., "[{level} | {name}]: {msg}") would just work and we could make that switch easily.

ScottPJones commented 4 years ago

I've concentrated more on the C format side of the package, as that is what I mostly use. These days I'm spending more time with Python code (rewriting Numpy code in Julia for better performance and future flexibility) for my day job, so having full Python syntax support would be nice for me as well. As always, any PRs (or reviews of any PRs I put up for adding those features) are welcome!