Debugging

1,087 views
Skip to first unread message

Desmond Kang

unread,
Jun 14, 2022, 12:15:50 PM6/14/22
to ONOS Developers
Hi ONOS Developers,
I'm Developing apps on ONOS using Bazel and I want to know whether if my variables are getting the right values, so I want to use the log.debug() method to print them out in a CLI interface.

I've tested using "bazel run onos-local -- clean debug" but did not see my log messages come out.

I want to ask how do you guys do it. Is there a special command where you guys type when starting the onos service in debug mode? like "bazel run onos-local -- clean debug" ? And after the onos service is running, where do you guys see the log output? Is it from the same terminal where we typed in the run onos command? or from the onos cli? 

Thanks in advance!

Davide Scano

unread,
Jun 14, 2022, 12:21:01 PM6/14/22
to ONOS Developers, desmon...@gmail.com
Hi Desmond,

You can use in the ONOS CLI log:tail DEBUG and you get only the log.debug messages,  you should also see them in the ONOS log. For testing your application you can develop unit test or test your app in your use case.

best
Davide

Desmond Kang

unread,
Jun 15, 2022, 8:53:52 AM6/15/22
to ONOS Developers, 0ice...@gmail.com, Desmond Kang
Hi, I've tried using "log:tail DEBUG" in the CLI, but nothings shows up.
I tried to search for the log documentation but dont seem to find any clues about log:tail taking any parameters.
2022-06-15 20_53_06-Clipboard.png

Desmond Kang

unread,
Jun 15, 2022, 8:58:35 AM6/15/22
to ONOS Developers, Desmond Kang, 0ice...@gmail.com
Hi, I found the solution.
first, enter 'log:get' to check the logging level of the ROOT entry, mine was INFO level, then I enter 'log:set DEBUG'. Now I'm getting DEBUG messages.
Reply all
Reply to author
Forward
0 new messages