Re: Gogo output not always showing

2015-01-21 Thread Bulu
My command is not doing anything fancy with System.out - just calling println(). Also I couldn't find any call to System.setOut() in my code. If the System.out is set globally how is it possible that some commands write to gogo shell while, at the same time, others write to the java std-out?

Re: Gogo output not always showing

2015-01-21 Thread Derek Baum
just add the command to start telnet to gosh.args: java -Dgosh.args='--nointeractive -c telnetd start' -jar bin/felix.jar Note: if you are using Java 8, you need gogo.shell (0.12.0) to fix FELIX-4425 — Derek On 21 Jan 2015, at 08:12, Bulu b...@romandie.com wrote: Hello Derek I then

Re: Gogo output not always showing

2015-01-21 Thread Derek Baum
System.out is global within the JVM. The ThreadIO classes in gogo manage System.out (and System.in System.err) on a per-thread basis using System.setOut(PrintStream out) etc. This allows commands to simply read and write System.in System.out and work accordingly. For example: g! lb -s The

Re: Gogo output not always showing

2015-01-21 Thread Bulu
Hello again Using the internal telnetd does not fix the problem, output of this one command is still going to the java exe std-out instead of the gogo shell. But the command giving me problems is maybe not very standard: For one, it executes in a separate thread (not the shell/gogo thread).

Re: Gogo output not always showing

2015-01-21 Thread Bulu
OK, so one fix would be to run my command in a new thread created from within the gogo command and thus inheriting its ThreadLocals. I can't use ExecutorService, but that's not a big blocker. Will try that... Regards Philipp On 21.01.2015 13:35, Derek Baum wrote: I’ve thought more about

Re: Gogo output not always showing

2015-01-21 Thread Derek Baum
I’ve thought more about this. The gogo telnet daemon creates a new CommandSession, using the IO streams to the telnet client, which has the expected result of re-directing IO to the telnet client. gogo’s ThreadIO uses InheritableThreadLocal to manage the per-thread IO, so that any new thread

Gogo output not always showing

2015-01-20 Thread Bulu
Hello In my gogo commands, I use simple System.println(...) calls to output things to the gogo shell. (is that the correct way?) I then access gogo through telnet (Felix Remote Shell 1.1.2). Sometimes (rarely), certain of my commands do no longer output to the shell, instead the output is