logger.info is not printing in log when using remote librarry

188 views
Skip to first unread message

Beno K Immanuel

unread,
Sep 6, 2013, 7:39:50 AM9/6/13
to robotframe...@googlegroups.com
Hi ,

I am using remote library to run python script on remote server . In the python script am using logger.info .Printing some information using logger.info in that script. But the message is not displaying the log . But its printing in the terminal. if print is using in the script its prints in the Log .How to resolve this ?? any one can help me .??

regards,
Beno 

Kevin O.

unread,
Sep 6, 2013, 9:46:18 AM9/6/13
to robotframe...@googlegroups.com
I logged an issue about this.
The remote server script is quite simplified and not as feature-rich as RF is.
The Python logging outputs to sys.stderr by default and the remote server only captures sys.stdout.

There are a few options here
1) get the Python logging to log to stdout.
2) modify the remote server to capture stderr in addition to stdout
3) use your own logger.

Here is a start to writing your own logger:

import time

def info(msg):
    log('INFO', msg)

def log(level, msg)
    epoch = int(time.time())
    msg = str(msg)
    print "*%s:%s* %s" % (level, epoch, msg)
Reply all
Reply to author
Forward
0 new messages