Skip to content
Snippets Groups Projects
Verified Commit 9a79c6f7 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

lua logging: expand the printf in lua already

- we've been using lua's formatting so far, so avoid changing that
- some lua values would be harder to format with the C style
parent 338b5a93
No related branches found
No related tags found
1 merge request!1181Fine grained logging
Pipeline #86148 failed
Pipeline: Knot Resolver

#86149

    ......@@ -32,15 +32,17 @@ local function curr_line() return debug.getinfo(4,'l').currentline end
    local function log_fmt(grp, level, fmt, ...)
    ffi.C.kr_log_fmt(grp, level, 'CODE_FILE='..curr_file(), 'CODE_LINE='..curr_line(), '',
    '[%-6s] ' .. fmt .. '\n', ffi.C.kr_log_grp2name(grp), ...)
    '[%-6s] %s\n', ffi.C.kr_log_grp2name(grp), string.format(fmt, ...))
    end
    function log_req(req, qry_uid, indent, grp, fmt, ...)
    ffi.C.kr_log_req1(req, qry_uid, indent, grp, ffi.C.kr_log_grp2name(grp), fmt, ...)
    ffi.C.kr_log_req1(req, qry_uid, indent, grp, ffi.C.kr_log_grp2name(grp),
    '%s\n', string.format(fmt, ...))
    end
    function log_qry(qry, grp, fmt, ...)
    ffi.C.kr_log_q1(qry, grp, ffi.C.kr_log_grp2name(grp), fmt, ...)
    ffi.C.kr_log_q1(qry, grp, ffi.C.kr_log_grp2name(grp),
    '%s\n', string.format(fmt, ...))
    end
    function panic(fmt, ...)
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment