Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*printf %y arg results in period separators instead of commas for lists and hashes #3947

Closed
davidnich opened this issue Jun 10, 2020 · 1 comment

Comments

@davidnich
Copy link
Contributor

ex:

2020-06-10 08:46:47.167245 qorus-0:65 T6: publishing event: ["MR-PUB-PROCESS-MEMORY-CHANGE". {id: "qdsp-omq", restarted: False, node: "qorus-0", status: 2, status_string: "RUNNING", urls: ["tcp://172.17.0.4:44479"], host: "qorus-0", pid: 51425, type: "qdsp", client_id: "omq", started: 2020-06-10 05:53:28.978890 Wed +00:00 (UTC), vsz: 2126946304, rss: 32739328, priv: 24446976, priv_str: "23.31 MiB", connstr: "pgsql:omqk8s/omqk8s@omqk8s%manatee{min=3,max=10}", pct: 0, node_priv: 2340648960, node_priv_str: "2.18 GiB", node_ram: 134965501952, node_ram_str: "125.70 GiB", node_ram_in_use: 103624409088, node_ram_in_use_str: "96.51 GiB", node_cpu_count: 32, node_load_pct: 1.71875}]

code:

QDBG_LOG("publishing event: %y", v);

ex:

2020-06-10 08:46:46.896981 qorus-0:65 T7: QorusMaster::publishRemoteNodeInfo() "qorus-1": {node_priv: 977789952. node_priv_str: "932.49 MiB". node_ram_in_use: 104507805696, node_ram_in_use_str: "97.33 GiB", node_cpu_count: 32, node_load_pct: 1.90625, machine_ram_total: 134965501952, machine_load_pct: 1.59375}

code:

QDBG_LOG("QorusMaster::publishRemoteNodeInfo() %y: %y", node, node_info);

C++ code for lists in QoreListNode.cpp:

    if (foff == FMT_YAML_SHORT) {
        str.concat('[');
        ConstListIterator li(this);
        while (li.next()) {
            QoreValue n = li.getValue();
            if (n.getAsString(str, foff, xsink))
                return -1;
            if (!li.last())
                str.concat(", ");
        }
        str.concat(']');
        return 0;
    }

C++ code for hashes in QoreHashNode.cpp:

if (foff == FMT_YAML_SHORT) {
        str.concat('[');
        ConstListIterator li(this);
        while (li.next()) {
            QoreValue n = li.getValue();
            if (n.getAsString(str, foff, xsink))
                return -1;
            if (!li.last())
                str.concat(", ");
        }
        str.concat(']');
        return 0;
    }
@davidnich davidnich added this to the 0.9.5 milestone Jun 10, 2020
@davidnich davidnich self-assigned this Jun 10, 2020
davidnich added a commit that referenced this issue Oct 14, 2020
…ngs as well as fixing "," separators to always be ","
davidnich added a commit that referenced this issue Oct 14, 2020
@davidnich
Copy link
Contributor Author

the bug was in calls to internal function q_fix_decimal()

davidnich added a commit that referenced this issue Oct 14, 2020
#4041)

* refs #3947 fixed bugs converting round floating-point numbers to strings as well as fixing "," separators to always be ","

* refs #3947 do not add a decimal point if the string already has an exponent

* refs #3947 fixed bug in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant