cancel
Showing results for 
Search instead for 
Did you mean: 

PyKx Console not showing from IPC Port

cleung
New Contributor

Hi there, 

I'm pretty new to using PyKX, and when migrating our code over from KDB to PyKX, we are running into issues with logging. We are using QConnection/IPC to grab a port in an existing environment, and query functions now via python. However, what's missing is that when these functions get executed, the logs (stdout) are not being recorded in the python console, most likely because the logs are not being translated from the ports consolt to the Python console. Is there any workaround this? 

 

Thanks for your help!

Charles

2 REPLIES 2

rocuinneagain
Contributor III
Contributor III

Is this what you mean;

 

You have a q server with a function which logs some information:

 

q)\p 5000
p)func:{-1 "Logging some info on params:",.Q.s1 (x;y);x+y}

 

You call that function from PyKX:

 

>>> conn = pykx.QConnection('127.0.0.1', 5000)
>>> conn("func",4,5)
pykx.LongAtom(pykx.q('9'))

 

In the q console the log is printed:

 

q)
Logging some info on params:4 5

 

But you would like this message to be logged in your PyKX console?

The standard functionality will not print those messages logged to SDTOUT back to your python process.

Yeah that sounds about right. The original function has STDOUT so the logs are visible to the Q Console only, but not the python consonsole where PYKX is running.

 

Since we use many many functions with this logging feature already, is there a way we can have logs from Q server relayed back to the PyKX console? Doesn't have to be STDOUT but maybe through another process?

 

Thanks