GithubHelp home page GithubHelp logo

Comments (7)

nathaniel-lehrer-ib avatar nathaniel-lehrer-ib commented on May 26, 2024 1

Thanks for your response and continued development on this!

from err2.

lainio avatar lainio commented on May 26, 2024

Hello,

Thank you so much for the kind words and the feedback! Highly appreciate.

My first thought about your request is that I need to do something about that 👍

This was the first implementation to get more information about the subject. During the first implementation, I noticed those marginal cases like anonymous functions (.Func1) and how to treat the actual package name (uuid.New() -> "uuid new" is better than just "new", but not always!). Our use cases are covered by simple decameling because we rely on logs for err2's error trace functionality and assertations. But yes, I'll look for the next-best solution and hopefully a simple API.

My gut feeling is that I'll bring a formatter interface and a few default implementations like decamel and noop. I will cover this in the next release.

Once again, thanks for the feedback!

from err2.

lainio avatar lainio commented on May 26, 2024

FYI PR #11 now fixes the decamel bugs. I'll think I will release it quite soon, but before that, I am trying to think of a new config API where err2 callers could bring their own formatters as well. Letting you know..

from err2.

lainio avatar lainio commented on May 26, 2024

There is now a new version, v0.8.13. Please check it out.

from err2.

lainio avatar lainio commented on May 26, 2024

I'm preparing to close this issue. Here's an additional example of how to implement and set your own Formatter:

	err2.SetFormatter(&formatter.Formatter{
		DoFmt: func(raw string) string {
			return "my ERROR: " + raw
		},
	})

Anybody please let me know if you find any bugs or annoying things in the formatted API. Thanks!

from err2.

nathaniel-lehrer-ib avatar nathaniel-lehrer-ib commented on May 26, 2024

Thanks for the update! Will let you know if anything else comes up :D

from err2.

lainio avatar lainio commented on May 26, 2024

The new API and fix are working. Fixing the issue.

from err2.

Related Issues (4)

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.