Giter VIP home page Giter VIP logo

Comments (6)

sirnewton01 avatar sirnewton01 commented on June 17, 2024

The built-in log package is probably sufficient for this project's needs.

from dgit.

driusan avatar driusan commented on June 17, 2024

The main reason I haven't used the built-in log package is because of the timestamp that it adds by default, making it harder to get the exact same output as real git which just prints error message to stderr when things go wrong. (I assume there's a way to customize the timestamp, but I haven't looked into it.)

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

Perhaps we could use the golang logging for debugging and tracing level information and Printf for expected messages and errors? This would allow us to turn the debugging and tracing on/off at runtime and still match standard git. What do you think?

To be concrete, there can be one or more loggers that are configured using the GIT_TRACE environment variable. If the variable is not present then the loggers are no-op. If the variable is set to 1 or 2 then they dump file-name, line number and message information (ie. log.Lshortfile), which avoid dumping timestamps. Note that standard git will actually dump a timestamp for its timestamps, which would be equivalent roughly to log.Ldate | log.Ltime | log.Lshortfile.

GIT_TRACE also supports providing file paths to dump the trace. Loggers can be easily configured to write the messages to the specified file.

from dgit.

driusan avatar driusan commented on June 17, 2024

That sounds like a pretty solid plan someone wants to do it, but it sounds like a lot of work to get it set up that I don't have the time to do personally. The only thing I'd suggest changing is checking a DGIT_TRACE variable which supercedes GIT_TRACE, so that git and dgit tracing levels can be set independently.

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

I have implemented this in Pull Request #37

from dgit.

driusan avatar driusan commented on June 17, 2024

Merged

from dgit.

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.