-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Replace NewLines Layout Renderer Wrapper #800
Conversation
Synced the project files.
Thanks! It seems that to unused What's the benefit of the config property? |
I thought I had removed the unused |
Removed redundant property.
OK. You need to copy the file header of another file to it to fix the failing unit test. |
I looks nice! short and clean 👍 Maybe we could also make it configurable how to replace the newline? Because I was expecting "" (no chars), but a space is also an option. I propose to add the property: What do you think? |
I like the idea. I was thinking it needed an option to control the separation character/string. I figured having no separator would make it hard to read. |
Scratch that. Can you use an auto property and init the properties in the constructor? That's preferred and more consistent with other code in NLog. Thanks! |
You can ignore the failing unit test. That one is failing really sometimes (so there is really something wrong but not in this code) |
…nit in constructor.
Sorry, I really should have checked how the other properties had been implemented. |
No problem. It's just a matter of style. |
We will include this in 4.1 :) One last thing: can you document this on the wiki? (new page) Maybe also reference from https://github.com/NLog/NLog/wiki/Replace-Layout-Renderer |
Added a documentation page to the wiki here: https://github.com/NLog/NLog/wiki/Replace-NewLines-Layout-Renderer |
OK thanks, I added also your examples and a 4.1 notice. But I missed something. How does the test |
The ReplaceNewLineOneLineTest was added for a check that it wasn't applying when it wasn't meant to. The default could be replaced with an empty string. My preference is to have a space to help keep it a little bit more readable by default. |
The default of space is good. But replace with a empty value is a corner case. We need an unit test for that. Can you add this unit test? |
Thanks! It has been merged :) |
Replace NewLines Layout Renderer Wrapper
Added a layout renderer wrapper to replace newline characters with spaces as per issue #86