Bug 73151 - [logview] log browser
Summary: [logview] log browser
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Jacek Pospychala CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on:
Blocks: 217276 217277
  Show dependency tree
 
Reported: 2004-09-02 09:47 EDT by Pascal Rapicault CLA
Modified: 2008-01-31 10:58 EST (History)
5 users (show)

See Also:


Attachments
mylyn/context/zip (727 bytes, application/octet-stream)
2007-11-07 20:11 EST, Chris Aniszczyk CLA
no flags Details
rough patch (11.52 KB, patch)
2007-12-09 18:00 EST, Jacek Pospychala CLA
no flags Details | Diff
mylyn/context/zip (1.90 KB, application/octet-stream)
2007-12-09 18:00 EST, Jacek Pospychala CLA
no flags Details
preview (9.27 KB, image/png)
2007-12-09 18:02 EST, Jacek Pospychala CLA
no flags Details
patch (24.50 KB, patch)
2008-01-05 15:14 EST, Jacek Pospychala CLA
no flags Details | Diff
mylyn/context/zip (9.39 KB, application/octet-stream)
2008-01-05 15:14 EST, Jacek Pospychala CLA
no flags Details
updated patch (19.50 KB, patch)
2008-01-29 17:33 EST, Jacek Pospychala CLA
no flags Details | Diff
org.eclipse.pde.patch (22.83 KB, patch)
2008-01-29 19:01 EST, Chris Aniszczyk CLA
no flags Details | Diff
mylyn/context/zip (12.96 KB, application/octet-stream)
2008-01-29 19:01 EST, Chris Aniszczyk CLA
no flags Details
patch (20.48 KB, patch)
2008-01-30 17:44 EST, Jacek Pospychala CLA
no flags Details | Diff
mylyn/context/zip (16.68 KB, application/octet-stream)
2008-01-31 10:58 EST, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2004-09-02 09:47:25 EDT
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 :-).
Comment 1 Wassim Melhem CLA 2004-09-02 13:24:44 EDT
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.
Comment 2 Pascal Rapicault CLA 2004-09-02 13:54:46 EDT
But it would have to be hooked up in the developped application which is not 
very interesting (if this is what you meant).
Comment 3 Jean-Michel Lemieux CLA 2004-09-02 14:26:29 EDT
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.
Comment 4 Wassim Melhem CLA 2004-09-02 14:53:37 EDT
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?
Comment 5 Jean-Michel Lemieux CLA 2004-09-02 15:00:44 EDT
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.
Comment 6 Wassim Melhem CLA 2004-09-02 15:06:35 EDT
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.

Comment 7 Pascal Rapicault CLA 2004-09-02 15:40:08 EDT
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.
Comment 8 Wassim Melhem CLA 2004-09-02 15:46:50 EDT
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.
Comment 9 Jean-Michel Lemieux CLA 2004-09-02 16:14:32 EDT
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.
Comment 10 Wassim Melhem CLA 2004-09-02 18:42:25 EDT
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.
Comment 11 Jean-Michel Lemieux CLA 2004-10-18 10:29:08 EDT
An interim solution would be to run with -consoleLog. At least log output will 
be visible when running.
Comment 12 Wassim Melhem CLA 2005-01-20 22:54:00 EST
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.
Comment 13 Jean-Michel Lemieux CLA 2005-01-21 08:57:45 EST
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.
Comment 14 Chris Aniszczyk CLA 2007-11-07 20:11:53 EST
updating summary
Comment 15 Chris Aniszczyk CLA 2007-11-07 20:11:59 EST
Created attachment 82404 [details]
mylyn/context/zip
Comment 16 Jacek Pospychala CLA 2007-12-09 17:50:48 EST
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.
Comment 17 Jacek Pospychala CLA 2007-12-09 18:00:07 EST
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.
Comment 18 Jacek Pospychala CLA 2007-12-09 18:00:12 EST
Created attachment 84823 [details]
mylyn/context/zip
Comment 19 Jacek Pospychala CLA 2007-12-09 18:02:38 EST
Created attachment 84824 [details]
preview
Comment 20 Wassim Melhem CLA 2007-12-09 18:05:59 EST
The screenshot is everything I imagined it would be :)
Comment 21 Chris Aniszczyk CLA 2007-12-10 14:11:50 EST
omg! :D
Comment 22 Chris Aniszczyk CLA 2007-12-10 16:20:04 EST
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 ;)
Comment 23 Jacek Pospychala CLA 2007-12-10 18:51:08 EST
(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.
Comment 24 Jacek Pospychala CLA 2008-01-05 15:14:01 EST
Created attachment 86265 [details]
patch

looking for your comments.
Comment 25 Jacek Pospychala CLA 2008-01-05 15:14:05 EST
Created attachment 86266 [details]
mylyn/context/zip
Comment 26 Chris Aniszczyk CLA 2008-01-29 14:38:39 EST
reviewing now...
Comment 27 Chris Aniszczyk CLA 2008-01-29 15:02:00 EST
Jacek, can you attach an updated patch without any issues? I want to get this in for M5 :)
Comment 28 Jacek Pospychala CLA 2008-01-29 17:33:44 EST
Created attachment 88211 [details]
updated patch

sorry Chris, here's updated patch
Comment 29 Chris Aniszczyk CLA 2008-01-29 19:01:46 EST
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"
Comment 30 Chris Aniszczyk CLA 2008-01-29 19:01:49 EST
Created attachment 88222 [details]
mylyn/context/zip
Comment 31 Chris Aniszczyk CLA 2008-01-30 14:30:25 EST
poke?
Comment 32 Jacek Pospychala CLA 2008-01-30 16:05:04 EST
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...
Comment 33 Jacek Pospychala CLA 2008-01-30 17:44:13 EST
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 ;)
Comment 34 Chris Aniszczyk CLA 2008-01-31 10:58:04 EST
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 :)
Comment 35 Chris Aniszczyk CLA 2008-01-31 10:58:15 EST
Created attachment 88424 [details]
mylyn/context/zip