I have several QiMessaging
services and I use qi.logging
to log some info/debug messages on the console (see qi.logging API). When I run the service remotely I can to see the logs from qi.logging
but when the service is running and installed on the robot I can not see any logs from Choregraphe Log View. Is it normal?
I tested and this util tool but the result is same.
Do you have any idea why this is happening?
Have you checked the "Show all logs" checkbox at the bottom left of the log view?
I run this script (using the stk utilities you link to):
import stk.runner
import stk.logging
class Activity(object):
APP_ID = "com.aldebaran.testlogs"
def __init__(self, qiapp):
self.logger = stk.logging.get_logger(qiapp.session, self.APP_ID)
def on_start(self):
self.logger.warning("THIS IS MY LOG!")
if __name__ == "__main__":
stk.runner.run_activity(Activity)
... and get the logs in Choregraphe:
[INFO ] core.processmanager.qt :callBackStateChanged:0 testlogs.main has started
[WARN ] core.alservicemanager :startService:0 'startService' is deprecated: Use 'start' instead
[INFO ] core.processmanager.qt :start:0 Starting /usr/bin/python2 scripts/main.py in /home/nao/.local/share/PackageManager/apps/testlogs
[INFO ] core.alservicemanager :start:0 Starting service testlogs.main
[WARN ] com.aldebaran.testlogs scripts/main.py:on_start:20 THIS IS MY LOG!
Which version of Choregraphe / NAOqi are you using? If my memory serves me well the logging may not work right in NAOqi 2.1, but later versions (2.5 on Pepper, 2.8 on NAO v6) should work fine (I haven't tested recently though, so could be misremembering).
Note that you can also use the Log Viewer tool in Monitor.