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



however, I can launch the station if 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)
The path-to-file.txt should 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)