Jens-Uwe Mager
2005-06-24 18:11:34 UTC
I did submit a patch a while ago to add a console tab to LimeWire.
Recently there was some discussion about adding something like a
console, so I reworked the patch to be relative to the newest CVS and
also to use log4j instead of what was previously the preferred logger.
This console patch does do the following things:
* adding a new tab that displays the console window (not shown unless
enabled, like the connection view)
* adds statements to log4j.properties to be able to redirect log
messages to the console window.
* being based on the BeanShell JConsole window, also add BeanShell
scripting to LimeWire.
The scripting feature does warrent more explanation. The JConsole window
is actually a feature of BeanShell (www.beanshell.org), and the file
bsh-2.0b4.jar needs to be put into lib/jars for the patch to work. The
result ist that you can simply type java style expressions into the
console window and let BeanShell evaluate it and print the results, this
is really handy to inspect all the variables of the running LimeWire.
Part of the evaluation can also be arbitrary method calls, so you can
also trigger Java code to be run. You can also set variables, that
allows easy experimentation with parameters without recompiling LimeWire
or adding settings for them.
Part of the initialization of the BeanShell tab is also evaluating the
file LimeWire.bsh (if it exists) in the preferences directory. This can
be used to add some handy functions or other customizations to the
console. It can also be used to modify LimeWire's behaviour in various
ways, I have included an example LimeWire.bsh file that adds a BeanShell
menu that allows to refresh the logging preferences besides other play
things.
As BeanShell pretty much supports nearly all of the Java syntax and some
more loosely typed scripting extensions it is also a nice tool to
prototype new functionality that can be later simply compiled into
classes.
Recently there was some discussion about adding something like a
console, so I reworked the patch to be relative to the newest CVS and
also to use log4j instead of what was previously the preferred logger.
This console patch does do the following things:
* adding a new tab that displays the console window (not shown unless
enabled, like the connection view)
* adds statements to log4j.properties to be able to redirect log
messages to the console window.
* being based on the BeanShell JConsole window, also add BeanShell
scripting to LimeWire.
The scripting feature does warrent more explanation. The JConsole window
is actually a feature of BeanShell (www.beanshell.org), and the file
bsh-2.0b4.jar needs to be put into lib/jars for the patch to work. The
result ist that you can simply type java style expressions into the
console window and let BeanShell evaluate it and print the results, this
is really handy to inspect all the variables of the running LimeWire.
Part of the evaluation can also be arbitrary method calls, so you can
also trigger Java code to be run. You can also set variables, that
allows easy experimentation with parameters without recompiling LimeWire
or adding settings for them.
Part of the initialization of the BeanShell tab is also evaluating the
file LimeWire.bsh (if it exists) in the preferences directory. This can
be used to add some handy functions or other customizations to the
console. It can also be used to modify LimeWire's behaviour in various
ways, I have included an example LimeWire.bsh file that adds a BeanShell
menu that allows to refresh the logging preferences besides other play
things.
As BeanShell pretty much supports nearly all of the Java syntax and some
more loosely typed scripting extensions it is also a nice tool to
prototype new functionality that can be later simply compiled into
classes.
--
Jens-Uwe Mager <pgp-mailto:F476EBC2>
Jens-Uwe Mager <pgp-mailto:F476EBC2>