By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

logging in omniORB for python

P: n/a
Hello newsgroup,

I work with omniORB for python and I what to log the calls, does anyone in
this group know how I can do this?
I use the command to initialize the ORB
ORB = CORBA.ORB_init(sys.argv + ["-ORBtraceLevel", "40"], CORBA.ORB_ID)
but I dont get a log file or a message in pythonwin output display about
anything.
Does anyone know, were the log data is? And how I can store it in a file?
By the way I ask also the omniORB mailing list, but here are the python
experts.

--

Mit freundlichen Grüßen / best regards
Birgit Rahm
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
f
Birgit Rahm wrote:
Hello newsgroup,


Hello Birgit,

I haven't found any way to do logging in a standard way.

The solution i've implemented is to decorate each method you want to log
the call, using the logging module (included in python since 2.3)

For example :

import logging

def loggedmethod(method):
logger = logging.getLogger('mylogger')
def _loggedmethod(self, *args, **kw):
logger.debug('## %s was called ##' % method.func_name)
return method(self, *args, **kw)
return _loggedmethod

# imagine A is your corba object
class A:
def foo(self):
return 'foo'

foo = loggedmethod(foo)

if __name__ == '__main__':
logger = logging.getLogger("mylogger")
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
a = A()
print a.foo()


when running :

bash-2.05b$ python plop.py
## foo was called ##
foo

Jul 18 '05 #2

P: n/a
> Does anyone know, were the log data is? And how I can store it in a file?
By the way I ask also the omniORB mailing list, but here are the python
experts.


it gets written to stdout - and then looks like this:

omniORB: ObjRef(IDL:ehotel.de/omphalos/Domain:1.0) -- deleted.
omniORB: inputMessage: from giop:tcp:192.168.1.3:33465 76 bytes
omniORB:
4749 4f50 0102 0100 4000 0000 1400 0000 GIOP....@.......
0300 0000 0000 0000 0e00 0000 fe81 18c0 ................
4100 0016 9800 0000 0002 0000 1600 0000 A...............
6765 7454 7261 6e73 6163 7469 6f6e 436f getTransactionCo
6e74 6578 7400 4c3a 0000 0000 ntext.L:....

So check out what happens to you stdout.

--
Regards,

Diez B. Roggisch
Jul 18 '05 #3

P: n/a

In article <cp*************@news.t-online.com>,
Diez B. Roggisch <de*********@web.de> wrote:
Does anyone know, were the log data is? And how I can store it in a file?
By the way I ask also the omniORB mailing list, but here are the python
experts.


it gets written to stdout - and then looks like this:


To avoid any confusion, it actually gets written to stderr, not
stdout.

Cheers,

Duncan.

--
-- Duncan Grisby --
-- du****@grisby.org --
-- http://www.grisby.org --
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.