2 weeks ago
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 weeks ago - last edited 2 weeks ago
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.
2 weeks ago
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
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.