Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Launch rdk using Robolink without printing rdk logs on stdout
#1
I try to launch RoboDK like this:
rdk = robolink.Robolink(close_std_out=True)
but then my python console output is polluted by the robodk logs.

I can do the following to keep the robodk logs out of my console:
rdk = robolink.Robolink(args=["-DEBUG"],close_std_out=True)
station = rdk.AddFile(station_filepath) #this will fail



然而,我可以发射空间站I first create a new Robolink instance
rdk = robolink.Robolink(args=["-DEBUG"],close_std_out=True)
rdk = robolink.Robolink() # new instance
station = rdk.AddFile(station_filepath) # now this works

my setup:
robodk python API version: 5.5.0
robodk version: v5.5.0
Ubuntu 20.04.5 LTS
#2
You can pass a file to save your debug output in a file instead of having it through the stdout pipe. You can do so by specifying the path to the text file like this:
Code:
rdk = robolink.Robolink(args=["-DEBUG=./path-to-file.txt"],close_std_out=True)
Thepath-to-file.txtshould be relative to the RoboDK executable/binary.

Alternatively, you can also customize the "output_reader" function in the Robolink module to customize the way the output is provided:
https://github.com/RoboDK/RoboDK-API/blo...k.py#L1289

Or feel free to suggest changes to the initalization of the Robolink module and we can make them official.




Users browsing this thread:
1 Guest(s)