-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Logging Window or Tab #288
Comments
Thanks. Nice to have: save to file. |
First pass at this is in. |
Provide a way to clear the log widget (not the log file) and show only new entries from that point in time on. Could be a filter for time (i.e. filter out entries earlier than hh:mm:ss) with a button to set time to "now" |
I already fiddled around with the logging on the weekend for some hours, but i had no luck in redirecting the output stream (stdout, stderr) to the Logger and keeping the output on the console. Can anyone give a hint on this or has a link to a working implementation of such a logger redirect? |
@pfried The basic idea is to make a new implementation of PrintStream that sends it's output both to the original System.out and to the Logger. The same can be done for err with setErr. |
okay, same approach i had, but no luck. I cant remember the problem correctly since it was already some weeks ago. I will try again. |
Adding a SystemLogger class for redirecting stdout and stderr to tinylog, related to #288
just wanted to leave a quick working notice I started working on the features above, some things to note:
About the UI: For the search box and also for filtering i think i will "live" filter the underlying LogEntry List. I am thinking about the same for the LogLevels. The LineLimit is a bit pointless then, i would rather remove the line limit and set it to a fixed number. All other functionalities will happen on the filtered list e.g. save to file, copy to clipboard |
@pfried Agree on all points, looking forward to seeing the results! |
About the issue:
I added one for the System.out, but not for others, additional checkboxes are very easy to add if necessary
Done, searches whole LogEntry, so searching for class name is ease, also debug levels etc.
I am not so sure if that makes sense, i did not do it because all the permanent settings are hard to display, you would need a list for all logging classes (or the relevant ones) with their corresponding log levels
Acutally i do not know how to do this, maybe someone who did the multi window thing should take care of it.
Did not add as i think copying to clipboard is way easier and more helpful. Logs get saved anyway
Added a button for that |
Agree on all points. |
Many thanks to @pfried for finishing up many of the requested features! |
Some of the features have been temporarily reverted due to a performance problem in #467. |
i saw it, currently i am running a profile run, @vonnieda could you test disabling autoscroll and check if the problem persists? |
@pfried Yes, disabling auto scroll seems to fix it. |
About the general workflow, i think it would actually be nice if we had a more feature branch based workflow where features are in their own branch getting merged at a certain point. Of course there would need to be people who test the branches, but having to hotfix the develop branch is no solution either. I now cherry picked the commits related to logging and reapplied them. The history now has a ton of entriesm |
@pfried re: feature branches: this is how I do all of my work, and there's no reason that others can't, too. When I start a new feature I create a branch called feature/feature-name, do all the work and testing in that branch and then when I am happy with it I merge it to develop. Contributors can do the same by branching from develop and submitting a pull request from their branch. When you submit a pull request you are effectively asking me to merge the feature branch into the develop branch. Typically, if a PR is found to contain a bug after the fact I would not revert it, but instead fix or wait for a fix. But this one created such a serious performance problem that I thought it was best to remove it entirely temporarily until the problem could be solved. |
you are right, a bit unsatisfying that my commits caused that much trouble, i would have liked to fix it quickly, but your were so fast i had not enough time to provide a fix |
It's nothing to worry about. Bugs creep in. I'll review the new PR tonight and get it merged. |
Indeed, at first glance I'd say that the logger probably tries to send output to System.out or System.err when it encounters an error, which causes an infinite loop and stack overflow. @pfried, thoughts? |
One of the writer must have an issue with writing to its stream, but this could be the Console logger or the File Logger. Seems that we need to do a check if the stream is writable, or we catch all the errors without an output to the console. I had Exceptions before (the double line issue) but never saw a behaviour like @cri-s I will check if I can reproduce the behaviour by setting an invalid config |
Cannot reproduce it, @cri-s Could you apply the path below and check if it might solve the problem, only a quickshot
|
I may have reproduced this, or something quite like it. It only happens on Windows, because of another issue. When the OpenCV library shuts down it tries to delete a temporary file and gets an access denied. This causes an exception to be thrown, which the new logging stuff tries to log. This results (somehow) in a StackOverlowException. I can reproduce this simply by running OpenPnP on Windows and then exiting normally. I get a StackOverflowException in the console. Running under the debugger lets me see that this is happening somewhere in SystemLogger. I think this may be related to #442 |
That registry error is common, I've been seeing that on Windows for years and it doesn't seem to be a problem. I'm not sure why you would be getting a stack overflow on startup. Have you tried backing up and removing machine.xml? |
Okay, so it must be that the standalone editor is saving a value in the preferences (for the current directory) that somehow kills OpenPnP's reading of preferences. Can you please file this as a new issue? |
I have temporarily removed system logging as it was causing a whole host of issues. See comments in be475a2 |
I want to provide a fix for it and also for the StackOverflow. I am pretty busy right now (also due to building my own PnP machine 🤓, will do a forum post on this later on). Expect the fixes within the next 2-3 weeks |
Newline issue fixed in #579 |
I'm going to go ahead and close this as completed. All the major functionality has been added and there have no further requests for functionality. Future requests can be handled on a one by one basis. |
Suggestion from @TomKeddie:
We should have a logging window or tab that can be shown or hidden from the view menu. This will be very helpful for users setting up new machines and helping with debugging. It will also be very important for the scripting feature #282.
See #333 for potential changes to logging to make this work better.
The text was updated successfully, but these errors were encountered: