Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delimiter option #19

Open
Arkoniak opened this issue Aug 7, 2021 · 4 comments
Open

Add delimiter option #19

Arkoniak opened this issue Aug 7, 2021 · 4 comments
Labels
good first issue Good for newcomers

Comments

@Arkoniak
Copy link
Collaborator

Arkoniak commented Aug 7, 2021

Currently, key-value pairs are printed with ", " delimiter. It should be optional (and thus provides better possibilities for parsing resulting logs).

@Arkoniak Arkoniak added the good first issue Good for newcomers label Aug 7, 2021
@cossio
Copy link

cossio commented Apr 29, 2022

Can we have key-value pairs on different lines? Like so:

julia> @info "hello" x=4 y=2
┌ Info: hello
│   x = 4
└   y = 2

That's the default logger.

With MiniLogger, instead, I get

julia> with_logger(MiniLogger()) do
       @info "hello" x=4 y=2
       end
[2022-04-29 10:55:19] Info: hellox = 4, y = 2

I'd prefer to have the multi-line version by default.

@Arkoniak
Copy link
Collaborator Author

Arkoniak commented May 4, 2022

Initially, MiniLoggers were developed for usage in various servers, where all logs are channeled to log files, and after that goes to various log visualizing systems. That was the main reason, why all output was compacted into single line. Secondly, it's a matter of taste, but I do not like overly verbose logs, you have to do a lot of scrolling if you have multiple log commands.

I think that multiline logging can be added, but only as a secondary option, not default.

@cossio
Copy link

cossio commented May 4, 2022

I see. Just one question, in the above example:

julia> with_logger(MiniLogger()) do
       @info "hello" x=4 y=2
       end
[2022-04-29 10:55:19] Info: hellox = 4, y = 2

You see no space is printed between hello and x=4. Is there a way to make it insert a space or another delimiter there?
(Without me having to remember to add it manually after the "hello")

@Arkoniak
Copy link
Collaborator Author

Arkoniak commented May 4, 2022

Sure, the relevant code is https://github.com/JuliaLogging/MiniLoggers.jl/blob/master/src/minilogger.jl#L242-L253

I've made an issue for this bug: #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants