【问题标题】:How to do logging for errors only in kdb? (not results)如何仅在 kdb 中记录错误? (不是结果)
【发布时间】:2017-12-01 23:52:58
【问题描述】:

我想将所有错误记录到日志文件中,但不是查询结果。我在命令行中试过这个:

q test.q >kdb.log

但是,它会记录所有内容,甚至是结果中的那些数据。我只想记录错误。

【问题讨论】:

    标签: logging kdb


    【解决方案1】:

    您也可以从命令行执行:

    q test.q 1>stdout.log 2>stderr.log
    

    【讨论】:

    • 谢谢,如果我想写日志。我该怎么做。我试过 h:hopen :stderr.log; h"test"; how can i make next entries in different line? also, I wrote a function: logWrite:{[para]h:hopen :stderr.log; h"对"};它不起作用,因为 para 在引号内。你知道我如何传递参数吗?谢谢,特里
    【解决方案2】:

    您可以重定向标准输出和/或标准错误:http://code.kx.com/q/ref/syscmds/#1-2-redirect

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-25
    • 1970-01-01
    • 2018-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-27
    相关资源
    最近更新 更多