-
Notifications
You must be signed in to change notification settings - Fork 71
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
StringFormatters output newlines #285
Comments
Just confirming ... the formatters, when combined together, sometimes output too much data. So we will try to ensure they’re limited to a single line. @haf do you have a sample you can paste here that shows “too much data” and/or too many lines? |
I think we have two use-cases:
|
Sorry, it's not this issue that is fixed. The tests are passing, but the newline based formatters should still not print with newlines them for the console. |
@haf the user can easily provider their own what do you think ? |
I think that for non-literate console logging which is what LevelDateTimePathMessageNl was for we should by default output only single lines. For anything else, I think we should leave it like this and show how to use MessageWriter with the targets. |
#292 does this help ? |
I'm finding that I'm still missing docs for how to output a single line with the literate console. |
@haf misunderstanding your needs before. for |
It's neat, but I think a simple boolean to include this (default to true) would be great, actually. /cc @adamchester |
Yeah actually I made an attempt at creating one last night, but lots has changed so I got side tracked often. I think that’s the basic idea, just make a replacement for that function. I think the default for literate is good readability for a human. I think humans would want a new line separating exceptions and maybe other common elements, right? |
@adamchester Yes that is true; but in my use-case I need to debug a pretty verbosely logging service and the extra lines makes that impossible; the terminal can't hold all the text and most of the time of the developer goes to scrolling up and down and not finding what they want. That said; the extra space comes from the context always being printed and not from the exceptions. Perhaps we provide three variants; context + exn + line, exn + line and line-only + exn message? |
I agree @haf. I think we should introduce a similar concept which the Facade got first already in #234 and #247 (i.e. a customisable output template with built-in fields like I'm not sure when I would have time to tackle this myself, it could be days, weeks, months, or years away, but it is something I want to do. In the short term, I think we have inadvertantly prevented people from copying the built-in tokenise function with some internals, so we can make those public somehow, and also expose a few pre-built functions like you have suggested which cover the most common use cases out of the box. |
Done in beta.4. |
/cc @adamchester @lust4life
Question for you:
Logary/Formatting/StringFormatter.LevelDatetimePathMessageNl complex data
Outputs a huge chunk
It's safe to say the literate console is the thing people will debug with. Then: the string formatters should output single lines... Could you guys have a look at the tests for formatting, make sure they work across different Thread.CurrentCulture values and perhaps make them all (unless specified otherwise) output a single line with the data?
The text was updated successfully, but these errors were encountered: