We're Hiring!

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

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

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

Postby bernhard » Mon Jun 29, 2009 11:57 am

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
bernhard
 
Posts: 37
Joined: Mon Jun 22, 2009 7:18 am

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

Postby jmoore » Thu Jul 09, 2009 7:33 am

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()
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron