Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation of advantages of Flogger compared to JDK and other logging APIs #78

Open
usernamedd opened this issue May 6, 2019 · 6 comments
Labels
P3 type=documentation Documentation that is other than for an API type=enhancement Make an existing feature better

Comments

@usernamedd
Copy link

I just want to know details of its advantage, where to get the information?

@netdpb
Copy link
Member

netdpb commented May 6, 2019

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

@netdpb netdpb closed this as completed May 6, 2019
@kevinb9n
Copy link

kevinb9n commented May 6, 2019

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.

@cpovirk
Copy link
Member

cpovirk commented Apr 7, 2021

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!).

@cpovirk cpovirk reopened this Apr 7, 2021
@cpovirk cpovirk added P3 type=documentation Documentation that is other than for an API labels Apr 7, 2021
@netdpb netdpb changed the title what advantages of this log api compared with other log framework? Better documentation of advantages of Flogger compared to JDK and other logging APIs Apr 7, 2021
@raghsriniv raghsriniv added the type=enhancement Make an existing feature better label Apr 19, 2021
@jaredstehler
Copy link

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?

@deadmoose
Copy link

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)

@cpovirk
Copy link
Member

cpovirk commented Jan 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 type=documentation Documentation that is other than for an API type=enhancement Make an existing feature better
Projects
None yet
Development

No branches or pull requests

7 participants