Code Monkey home page Code Monkey logo

Comments (4)

AKARSHITJOSHI avatar AKARSHITJOSHI commented on May 18, 2024

Hi @akajla09 I would like to contribute on this.
My proposed solution would be to change log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
in config.go to log.With().Caller().Logger().Output(zerolog.ConsoleWriter{Out: os.Stderr}).
Let me know what you think about this.
PS: Thanks

from warrant.

akajla09 avatar akajla09 commented on May 18, 2024

Hi @AKARSHITJOSHI - thanks for offering to help. I haven't looked into this deeply so can't say for certain if this change will work. Have you tried it locally and tested it out? If you have a sample log output from the change, we can look at it to see if it contains the full filepath.

from warrant.

AKARSHITJOSHI avatar AKARSHITJOSHI commented on May 18, 2024

Please have a look at the following image
Screenshot 2023-04-09 at 11 06 34 AM

Message :
{"level":"fatal","error":"While parsing config: yaml: invalid trailing UTF-8 octet","time":"2023-04-09T11:05:49+05:30","caller":"/Users/personal/documents/warrant/pkg/config/config.go:88","message":"Error while reading warrant.yaml. Shutting down."}

The caller part is where the entire file path is shown . I tested the mentioned change in config.go

from warrant.

akajla09 avatar akajla09 commented on May 18, 2024

Can you submit a PR for this change? Looks like it does add the caller to error messages which is nice. However, I'm curious if it'll work for errors that are wrapped via Errors.wrap() (I can check that from your PR)

from warrant.

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.