gajus/roarr

Unexpected `[sprintf] unexpected placeholder` in simple logging (single param) strings contains a '%'

Closed this issue ยท 4 comments

code that reproduce the issue

    console.log("[[[");
    try {
        console.log(JSON.stringify(sparqlQueryScientificName.results));
        console.log("===");
        log.trace('%s', JSON.stringify(sparqlQueryScientificName.results));
    } catch(errorLogging) {
        log.error(errorLogging.message);
    }
    console.log("]]]");

actual

    [[[
    {"bindings":[{"scientificname":{"type":"literal","value":"Cucumis anguria"},"taxonrank":{"type":"uri","value":"http://www.wikidata.org/entity/Q7432"},"image":{"type":"uri","value":"http://commons.wikimedia.org/wiki/Special:FilePath/Cucumis%20anguria.JPG"},"taxonrankLabel":{"xml:lang":"en","type":"literal","value":"species"}}]}
    ===
    {"context":{"logLevel":50},"message":"[sprintf] unexpected placeholder","sequence":31,"time":1556820461648,"version":"1.0.0"}
    ]]]

expected

    [[[ 
    {"bindings":[{"scientificname":{"type":"literal","value":"Cucumis anguria"},"taxonrank":{"type":"uri","value":"http://www.wikidata.org/entity/Q7432"},"image":{"type":"uri","value":"http://commons.wikimedia.org/wiki/Special:FilePath/Cucumis%20anguria.JPG"},"taxonrankLabel":{"xml:lang":"en","type":"literal","value":"species"}}]}
    ===
    {"context":{"logLevel":10},"message":"{\"bindings\":[{\"scientificname\":{\"type\":\"literal\",\"value\":\"Cucumis anguria\"},\"taxonrank\":{\"type\":\"uri\",\"value\":\"http://www.wikidata.org/entity/Q7432\"},\"image\":{\"type\":\"uri\",\"value\":\"http://commons.wikimedia.org/wiki/Special:FilePath/Cucumis%20anguria.JPG\"},\"taxonrankLabel\":{\"xml:lang\":\"en\",\"type\":\"literal\",\"value\":\"species\"}}]}","sequence":33,"time":1556821362583,"version":"1.0.0"}
    ]]]

@gajus #20 should have all the tests passed and is ready to merge; I was wondering if you could proceed with closing the issue or if there are other reasons to wait; I would be very grateful if you let me know, thanks

really need this to be fixed ๐Ÿ™

gajus commented

Sorry for the delay.

gajus commented

๐ŸŽ‰ This issue has been resolved in version 2.15.4 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€