Page 1 of 1

Getting rid of [ .... Client Callback: sessionClose run ]

PostPosted: Mon Jun 29, 2009 11:57 am
by bernhard
Hi all!

I'm working interactively in an Omero session in a command line interface client. When ever the session times out I get a message printed to stdout, ie. my command line, similar to [ 29/06/09 13:42:27.424 ClientCallback: sessionClosed run ].

How can this be turned off, or redirected to /dev/null?

Thanks! Bernhard

Re: Getting rid of [ .... Client Callback: sessionClose run ]

PostPosted: Thu Jul 09, 2009 7:33 am
by jmoore
Hi, Bernhard!

Ok. A couple of points:
  • This should be fixed in a future version. Something along the lines of: "client.disableLogging()", but that won't help you any at the moment
  • If you are not using stderr for anything, you can redirect with --Ice.StdErr=/dev/null. See below for a concrete example of this.
  • If Ice.StdErr is not an option, the most straight-forward fix for the moment is to add your own logger. An example of that is also below. More info is available under: http://www.zeroc.com/doc/Ice-3.3.1/manual/Adv_server.33.20.html

Cheers, ~J.

Ice.StdErr Example
Code: Select all
import omero
c = omero.client("localhost", {"Ice.StdErr":"std.err"})
s = c.createSession("root", "ome")
print s          # Gets printed to stdout regularly
s.destroy()      # Gets sent to std.err file


Ice.Logger Example
Code: Select all
import Ice

class LoggerI(Ice.Logger):
  def trace(self, cat, string): pass
  def _print(self, string): pass
  def warning(self, string): pass
  def error(self, string): pass

id = Ice.InitializationData()
id.logger = LoggerI()

import omero
c = omero.client("localhost", id)
s = c.createSession("root", "ome")
print s
s.destroy()