Community
Participate
Working Groups
Today in eclipse, the wonderful log browser only displays log of the eclipse in which I'm developing. This is fine and interesting. However, when I'm developing an IDE without having PDE in my target, or simply when I'm developing an RCP application, finding the log becomes a headache. First I have to find where is my runtime-workspace then browse to it using windows explorer, and finally find the .log. It is even more complicated to find the log files from the configuration. What would be useful is a log browser indexed by the name of the "launch configuration" so I can easily open the logs. The cherry on the cake would be if some kind of indicators was telling me that the content of the log changed :-).
A better solution would be for the log/registry views to not be part of PDE anymore, as they are generic enough to be used without an IDE.
But it would have to be hooked up in the developped application which is not very interesting (if this is what you meant).
The main motivation for this bug is that when launching an workbench, and the workbench fails it is hard to find the log. Since PDE already provides both the launch and the log viewer, linking them together makes perfect sense. The nirvana of log support would be that if the launch failed, the log view would open with the log from the failed launch. And, as Pascal mentioned, if there could be a hint at the end of a launch that the log for the workbench has changed. This enhancement request if very much in the spirit of the RCP 3.1 theme.
Maybe I don't understand the request then. When a launch fails, PDE currently does tell you that there is a log and offers to open it for you. Isn't that what you want? Or is it not enough because it opens it in a system editor?
You are correct, if the launch fails you are prompted to see the log. That is good, but if the launch succeeds but an internal error occurs, you don't know where to look. Since the locations of these logs can be deterministically located, it would be a big bonus if the tool could help the user find them. Most of all, there existance, if the launch doesn't fail out-right, is hidden.
Once the runtime workbench is launched, PDE loses all contact with it, ie. our job is to launch it and that is it. So if something happens after the successful launch, PDE has no way of knowing that, and we therefore cannot help you out to find the log for you.
Although PDE does have any contact with the started platform, it knows where the log will be generated and could therefore watch the file to see it is size increases. Question, when the application started terminates, does the launch configuration gives you an opportunity to do something? If so, PDE could do the check proposed at that time.
PDE does have a launch listener that is notified when the launch terminates. That is how we know if a launch terminated abnormally (ie. we inspect the exit code) and offer to open the log. If the launch terminates normally, we don't do anything of course. You are suggesting that we check the size of the log at this time and offer to open a log if it had grown in size? Not sure this is a good idea. Example: you launch a runtime workbench and did a bunch of stuff and got a number of new log entries (e.g. during importing, exporting, etc.), and then you closed your runtime workbench. Imagine how annoyed you would be if PDE prompted you to show you the log entries from the runtime workbench you just closed.
I'm on the fence regarding the prompting at the end of the launch, but just having the log view allow easy access to the logs for all the launches is really cool.
By Jean-Michel's last comment, I think I now understand what Pascal originally was asking for. It would certainly be useful if the log view could show the content of the log in each of the launch configs. Prompting at the end of the launch is plain annoying and I don't see it happening.
An interim solution would be to run with -consoleLog. At least log output will be visible when running.
Ok, we'll do this one to motivate Jean-Michel to use my name in his upcoming book. Konrad, The log viewer already has an import/export function. We could address this by adding a new button to the toolbar that will allow the import of logs from launch configurations. A drop-down list of recently used launch configs would be nice. When selecting a launch config, PDE would search for the .log associated with that launch. Each launch may have more than one log associated with it: one in the .metadata subdirectory of the workspace area and >=0 <timestamp>.log files in the config area. In case there is more than one, we pick the one with the most recent timestamp and import it into the log viewer. The class LaunchListener already has the code that searches for all the possible logs in a launch config and finds the latest. You will need to copy that code into the pde.runtime plugin to keep it lightweight.
But if Konrad does the work, I'll have to mention him instead of you <g> I'm fine with your proposed implementation - note that I sill find it extremelly useful to run all my RCP apps with -consoleLog. It makes the warnings/errors very visible in the IDE. I'll leave it up to you to decide if you should add the option when Run As > Eclipse Application is selected.
updating summary
Created attachment 82404 [details] mylyn/context/zip
funnily, Log View has become vicitim of it's own success :) Since refactoring to new plug-in, it don't depend on PDE any more and getting to the LaunchListener (following Wassim's #12), is not that easy. (Note, LaunchListener can't be copy-pasted to LogView, as it depends on a number of XYZHelpers, that depend on PDECore). But, this gave me another idea, to provide a kind of service within LogView, where anyone could register it's log sources, and for example PDE could register it's launch configs logs. I'll attach a rough patch that makes this possible.
Created attachment 84822 [details] rough patch patch applies to org.eclipse.pde.ui and org.eclipse.pde.views.log There is a static LogSourcesManager, to which pde.ui adds it's LogSourcesProvider (during PDEPlugin.start()). This Manager is asked about log sources, whenever Import Log combo button is pressed in LogView. There are some discouraged access warnings. Instead of Manager maybe extension point would be cooler. New class in pde.ui may be in wrong package - I picked first that sounded good enough. Appreciate your comments.
Created attachment 84823 [details] mylyn/context/zip
Created attachment 84824 [details] preview
The screenshot is everything I imagined it would be :)
omg! :D
moving to M5, I don't have enough time to look at it for M4, however, it's really cool :) I do have a worry of adding PDE UI as another dep. Maybe we can try to contain all changes to org.eclipse.ui.views.log somehow? Thanks Jacek, people are getting spoiled with this view now ;)
(In reply to comment #22) > I do have a worry of adding PDE UI as another dep. Maybe we can try to contain > all changes to org.eclipse.ui.views.log somehow? there are no new dependencies in org.eclipse.ui.views.log. I'll try to come up with polished version at the end of the week.
Created attachment 86265 [details] patch looking for your comments.
Created attachment 86266 [details] mylyn/context/zip
reviewing now...
Jacek, can you attach an updated patch without any issues? I want to get this in for M5 :)
Created attachment 88211 [details] updated patch sorry Chris, here's updated patch
Created attachment 88221 [details] org.eclipse.pde.patch Almost there Jacek. I made some changes to the patch. For example, if you have no launch histories... it says "(no launch history)" instead of showing nothing. There is one bug I need you to investigate... if you right click on a log entry and get the menu... the Import Log action there doesn't work like the one in the toolbar... please fix and we'll consider this one a go for M5 :) To quote Brian, "This is a really cool feature"
Created attachment 88222 [details] mylyn/context/zip
poke?
should be in 1h - It's easy, but (In reply to comment #29) > There is one bug I need you to investigate... if you right click on a log entry > and get the menu... the Import Log action there doesn't work like the one in > the toolbar... please fix and we'll consider this one a go for M5 :) ah, should be in 1h - it's easy to fix, but I just found I was leaking menu objects...
Created attachment 88341 [details] patch popup menu fixed + fancy browser menu is disposed correctly now. btw, since I got addicted to babel (http://babel.eclipse.org/babel/translate.php) 2hours ago, everything else goes soo slow ;)
looks good Jacek, I opened bug 217276 and bug 217277 to deal with some UI-related issues that come up with this new awesome functionality :) Thanks for your hard work on this one, this is a nifty feature that will benefit all plug-in developers :)
Created attachment 88424 [details] mylyn/context/zip