Giter Site home page Giter Site logo

Comments (6)

kevinb9n avatar kevinb9n commented on August 31, 2024 1

If that information is hard to find, then we still have a bug here.

However, it appears to me that the main flogger page links to that page 5 times in its first two short sections. I usually am reluctant to conclude "we're already doing enough", but that does seem to be the case.

from flogger.

deadmoose avatar deadmoose commented on August 31, 2024 1

since even against a no-op call site, you are still creating the Object[] for the invocation? Or am I missing something fundamental here?

It's addressed in more detail in the docs: https://google.github.io/flogger/anatomy.html#avoiding-varargs

But TLDR: The API really does enumerate a giant pile of signatures so you're almost certainly calling one of those instead of needing to fallback to varargs

With the fluent api, you're able to have "only" those eleventy billion log() methods versus adding another dimension and having eleventy billion logFine()s plus another eleventy billion logInfo()s plus... (And then any other dimensions you want to bring into the mix like including a causing Throwable, the rate limiting, etc)

from flogger.

netdpb avatar netdpb commented on August 31, 2024

There's documentation of this here: https://google.github.io/flogger/benefits

from flogger.

cpovirk avatar cpovirk commented on August 31, 2024

Reopening to argue that we could do more here -- which is not to say that it needs to be a priority.

First, to reemphasize the last part of this sentence: I don't see any need to justify Flogger's existence: It solves problems that Google has, and by open sourcing it, we've made it available to both Google-run open-source projects and other potential users. That's a huge accomplishment for the past 8+ years.

So my framing, again, is that, if we do want to make the case to casual users for wider use, then we could take some actions to better highlight what Flogger has to offer. For example:

  • We do link to /benefits from many places, but one particular place that we don't link to it from is Yet another logging API? That would make a natural point for yet another link :)
  • We refer to Flogger as a "logging API." That is of course accurate :) It is also deceptively precise: It means that Flogger is not a backend. This distinguishes Flogger from many other logging "libraries" or "frameworks" -- terms that readers might casually think of as no different from "APIs."
  • The distinction between "API" and "backend" probably leads to other questions: Why all the talk about varargs and boxing when other logging frameworks talk about things like asynchrony (LMAX Disruptor!)?
  • Our main comparison is to the JDK logger. That's a comparison that is useful to have (compare our comparison of Truth to plain assertEquals), but if we want to answer the question "Yet another logging API?" then I think we should additionally include comparisons to slf4j and log4j APIs, which avoid the JDK's Throwable/not-Throwable ambiguity and provide lazy Supplier-based message construction (which I assume is still often slower and less convenient than Flogger's many overloads -- and that would be great to say!).

from flogger.

jaredstehler avatar jaredstehler commented on August 31, 2024

Apologies for a tangential nit, please feel free to ignore this, but I am struggling to wrap my head around how the fluent api avoids for varargs (from the "benefits" doc):

Vararg methods require a new Object[] to be allocated and filled before the method can be invoked

since even against a no-op call site, you are still creating the Object[] for the invocation? Or am I missing something fundamental here?

from flogger.

cpovirk avatar cpovirk commented on August 31, 2024

A teammate just shared https://tersesystems.com/blog/2022/01/02/echopraxia-a-better-java-logging-api/. For purposes of this thread, there may be some things to mine out of that post and its links. The one that caught my eye was https://github.com/obsidiandynamics/zerolog#okay-arent-there-enough-fa%C3%A7ades-already

from flogger.

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.