Coder Social home page Coder Social logo

Comments (4)

9382 avatar 9382 commented on August 17, 2024

I think the main issue here is that printf is complex and submits to out in parts but the OutputLogger is naive (or stupid depending on how you feel about it) and thinks that the message is "a different one" for each of its segments because its logic is very basic and therefore requires a timestamp.

Also, your usage of printf is confusing. Using a different example with proper args (System.out.printf("%s Test.", System.currentTimeMillis()); 3 times) creates 2024/05/11 22:13:21 | 17154620014562024/05/11 22:13:21 | Test.2024/05/11 22:13:21 | 17154620014672024/05/11 22:13:21 | Test.2024/05/11 22:13:21 | 17154620014672024/05/11 22:13:21 | Test. (you can clearly see it timestamping every "split" in the format)

I do have a potential solution in mind to mitigate this and am working on it right now

from gigavibe-java-edition.

WolfNT90 avatar WolfNT90 commented on August 17, 2024

Also, your usage of printf is confusing.

I realized later that I should've probably used it as I intended to use it, but I think my thought process must've been to simply showcase that any printf is faulty. My bad.

from gigavibe-java-edition.

9382 avatar 9382 commented on August 17, 2024

The new version (3733765) will now stop adding timestamps onto prints that dont terminate in newlines. Newlines that are part of the same print (and that get received by the logger in the same byte array, aka not printf's %n) will continue to only be timestamped at the start of the entire string (e.g. println("a\na\na")), which isn't great and this should probably be improved, but is no different from the old behaviour and is different to this specific bug

from gigavibe-java-edition.

9382 avatar 9382 commented on August 17, 2024

I've improved it further with 3a9a7ca (in functionality, the code itself looks a bit bad) to fix the behaviour I describe in my above comment. If there's any further issues (or new ones caused by this change that I haven't spotted), feel free to re-open this issue

from gigavibe-java-edition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.