-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Output to Paragraphs or Inlines #32
Conversation
TonyValenti
commented
Dec 7, 2021
- Outputting to Paragraphs instead of inlines
- Auto Scrolling
- Auto Trimming
* Outputting to Paragraphs instead of inlines * Auto Scrolling * Auto Trimming
@augustoproiete - Would you please merge this? Also, please merge the commit that has the thread processing loop. If there are bugs in it, I will fix them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TonyValenti Thanks for the PR! Could you split these into 3 separate PRs for each feature, and update the coding style to match the .editorconfig (eg. braces)
@augustoproiete - I can update the style but I can't split out the changes into separate PRs. I introduce a new interface/class (IRichTextBoxOutputAppender) and it handles these features. Updated PR coming soon. |
@augustoproiete - How do I make VS respect the custom editor config? |
@augustoproiete - I just took a look and this is difficult because the current editorconfig is extremely lenient and doesn't really seem to do much. Can you please either: |
Send a base PR that has new the interface + the paragraph changes, I can get that reviewed & merged, and you can send the next two follow-up PRs rebased on top of those changes |
I'd expect |
@augustoproiete - Please take a look at the code. The new interface incapsulates adding text to the text box. Two classes implement the interface: a legacy "inlines" provider that is the default and mimics old behavior and a new "paragraph" provider that adds paragraphs. It isnt' really possible to break the interface out from the impelmentations into separate commits because the one implementation is necessary in order for anything to work at all. Also doing format document doesn't change anything. Would you please review and merge? |
@TonyValenti To be clear, what I mean by 3 PRs is removing anything related to auto-scrolling and auto-trimming from this PR... Everything else stays which seems to be all the things you're mentioning above. We can address these two other features in follow-up PRs. Re: Format document, It's possible you have a non-default configuration on your machine (or ReSharper, or similar) getting in the way. Anyway, fix the curly brackets manually then, so they follow the C# convention and that should cover most of it |
@augustoproiete - I just added a commit that does the following:
Regarding the request to split the PR into multiple, I think it would be helpful to explain as to why that isn't really feasible: For example, here is the code for that appender:
You'll notice that the args have a flag that controlls whether it is scrolled or not. The
Would you please merge? |
@augustoproiete have you had a chance to review? |
Thanks @TonyValenti I had a chance to review the code and run some manual tests locally and overall the features you're trying to bring in are mostly working. There seems to be something going on with the first few events that are logged versus future events, as they don't seem to be added to paragraphs (see screenshot below): I'd like to release a v2.0.0 of this Sink where writing to Paragraphs is the default (rather than the legacy) to address the performance issues you found, update the tests and sample projects, and include docs on how to style the RichTextBox to behave visually the way that legacy does today, and then after that think about bringing other features such as Prepending and how to do that. For this v2.0.0 I'd like not to include Trimming, or Scrolling, or Prepending - these are separate features that can that can come later if it makes sense v2.1.0, etc. I'm not totally convinced AutoScrolling is a job of a Serilog Sink, for instance, seems like this should be a responsibility of the control. Also if This branch needs to be rebased on top of develop (that now includes that background worker and other things, and there's a few minor formatting issues with the code (brackets, spacing, empty lines) that needs fixing. I tried to do it myself, but I don't have permission to write to your repo - You can give me permission or fix it yourself and push --force
|
Hi @augustoproiete - Thanks for taking the time to review. I've just pushed a commit of my code that makes a number of adjustments. Specifically, there were some major issues with the threading code from the previous author: namely, it would create a thread for each logger and then each thread would basically spin while waiting for data. Also, RE trimming/scrolling: Anyways, the code is there if you want to check it out. We're using this commit with a lot of intensity and it is working great now. |
I'm looking at adding this package in the next few days. This will be for a debug feature but will be in a production app. Is this going to get merged? |
You should definitely not use the current version until this gets merged. The current version leaks threads and uses spinning threads which will really hurt your performance and impact stability. |
Is there a new update ? |
I'm not sure what happened to @augustoproiete . He controls the repo and seems to have disappeared. |
How can I help you @TonyValenti ? |
@Skaptor @TonyValenti I've outlined the issues with this PR in my comment above. The best course of action from here is to tackle the different issues / feature in separate individual pull-requests that can be easily reviewed & tested, and likely released separately:
Let me know if you are keen on getting those over the line. I'm closing this PR as-is based on the above. |
@augustoproiete, I am tackling breaking these up into multiple Pull Requests.
If necessary, I can break out change 3, and instead build 3 on 1 to segregate the two changes. They seem fairly disconnected, so I guess that's OK. If that is OK, I will go ahead and submit PRs for each. Should be done today. |
Hey @JonAdamsFromNC thanks for your interest in reviving this one. The memory leak issue is the most important one to solve - and release a new version as soon as it's tested & merged. In terms of sequence, your suggestion seems fine - though it might be easier to skip step 1, branch from current master and manually bring the changes for the threading improvements and others - but I'll leave it to you to decide Because of the dependencies between most of these PRs, you might want to wait for PR 1 to be merge before working on PR 2, etc. to simplify rebasing all the dependent PRs - but also up to you ps: If you use the code in this PR, make sure you add @TonyValenti as co-author, so he gets credit as well. |