[icedtea-web] resurrection of (output)console?

Jiri Vanek jvanek at redhat.com
Wed Nov 6 00:37:50 PST 2013

On 11/05/2013 08:44 PM, Omair Majid wrote:
> * Jiri Vanek<jvanek at redhat.com>  [2013-11-04 06:31]:
>> before you will wonder about removed redirectStreams, please test
>> patch :). Also it is remove in 1.5. Imho "debug" should have nothing
>> to do with "redirecting" also it was used wrongly, and made consoel
>> even less usefull...
> Let me break down the code:
> If the user has asked for logging, then log to java.stdout and
> java.stderr as well as the actual stdout/stderr.
> If the user has said ICEDTEAPLUGIN_DEBUG=true, then the C side of the
> plugin will be printing it's information on stdout/stderr. In that case,
> redirect the java-side to java.stdout and java.stderr.
> Can you explain the problem with this scheme?

What is wrong, is that debug is suddenly changing not the verbosity of output, but destination of output(without changing the verbosity actually).
  - In 1.4 we have javaconsole and stdout/err as debugging outputs
  - there is variable redirectStreams which is true if ICEDTEAPLUGIN_DEBUG is declared
    - in 1.4 ICEDTEAPLUGIN_DEBUG was affecting only C part, so it is suspicious
  - there is variable enableLogging, which is always false, because it is read from properties, *before* they are read from file (bug in 1.4, fixed in head) (it also depneds on -verbose, but for simplicity i will stay of as this (console) is just for applets part in 1.4)
    - as it is used, it is also duplicated withs console DISABLED/all_other_values

  - now the original "logging" was under condition redirectStreams || enableLogging, so it was depnding only on value of redirectStreams and so on ICEDTEAPLUGIN_DEBUG set.
   - suspicions isnt it?

  - if one declared ICEDTEAPLUGIN_DEBUG (whic is normally affecting verbosity of C part), sudddenly
    -  the console starts to work
    -  the verbosity of java part is still not-debug (so nothing interesting in console)
    -  the stdou/err is suddenly silenced

What I would expect:
- if console is disabled, then "logging" is going just to stdou/err (not included in my patch)
   - when it is enabled (shown or not) then stdout/err do tea both to files and stdout/err
- if console is enabled, stdout/err is still working fine (included in patch)
- when "debug" is on (whatever it is in 1.4) more information is printed both to console and plugin (included in this patch)
   - actually correct with your idea "its for java developers on systems which do not have access to stdout/err"

Its a week now when I wrote it (with blood in eyes:) )  so I hope I did not mess the explanation.

>> Now it is working as it should. ICEDTEAPLIGIN_DEBUG is setting level
>> of verbosity, and console is jsut another form of output.
> This patch is always logging to java.stdout/java.stderr, even if not
> asked for.
>> +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java	Mon Nov 04 12:18:40 2013 +0100
>> @@ -106,14 +106,15 @@
>>               PluginAppletSecurityContext.setStreamhandler(streamHandler);
>> +            //the properties are initialised during classlaoder creation
>> +            if (DeploymentConfiguration.VALUE_CONSOLE_STARTUP_MODE_SHOW.equals(
>> +                JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE))) {
>> +            PluginAppletSecurityContext.getStreamhandler().showConsole();
>> +        }
>>               AppletSecurityContextManager.addContext(0, sc);
> The addition of these lines look okay, but I am a little sceptical about
> the rest of the rest of the patch.

btw I did an mistake in patch:
+    public static final String VALUE_CONSOLE_STARTUP_MODE_SHOW = "SHOW";
is redundatn
SHOW is already declared as CONSOLE_SHOW.

I will push this part and we weill discuse the rest. But it really do not have sense for me :)


More information about the distro-pkg-dev mailing list