skygragon / leetcode-cli

A cli tool to enjoy leetcode!
MIT License
3.65k stars 457 forks source link

No Stdout in leetcode cli submit response #110

Open huangyingw opened 6 years ago

huangyingw commented 6 years ago

For example, this problem: 116. Populating Next Right Pointers in Each Node. Since it is not testable, so I have to directly submit it, and need stdout for debugging.

When I submit it directly from leetcode.com, I could see a Stdout section on the bottom of that page. While when I submit from command line: leetcode submit.... I could not see stdout.. I debug into your code, in submit.js

core.submitProblem(problem, function(e, results) {
  if (e) return log.fail(e);

    for (let i = 0; i < results.length; ++i) {
        let result = results[i];
        for (var key in result) {
            if (result.hasOwnProperty(key)) {
                console.log(key + " -> " + result[key]);
            }
        }
    }

I only see following output, on stdout

ok -> false answer -> undefined runtime -> N/A state -> Runtime Error testcase -> '{1,2,3}' passed -> 0 total -> 0 error -> Exception in thread "main" java.lang.NullPointerException at Solution.connect(Solution.java:20) at Driver.main(Driver.java:23) expected_answer -> undefined type -> Actual id -> 159485415

Then why submit directly from leetcode.com could see the stdout section. Are you using the same api ? I am trying to find the rest post details when submitting code, In Chrome, I use right click-> inspect -> console, while I see nothing.

skygragon commented 6 years ago

@huangyingw please try 2.5.3 release?