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

The design of the restriction position for "isLoggable" is unreasonable #269

Open
qlang122 opened this issue Dec 26, 2023 · 0 comments
Open

Comments

@qlang122
Copy link

The problem of design thinking!

Logger.json() -> LoggerPrinter.json() (json format in here, Time-consuming) -> LoggerPrinter.d() -> LoggerPrinter.log()

Action code:

for (LogAdapter adapter : logAdapters) {
      if (adapter.isLoggable(priority, tag)) {
        adapter.log(priority, tag, message);
      }
}

Why is this design problematic?

Because many users actually do this:

Logger.addLogAdapter(object : AndroidLogAdapter(formatStrategy) {
      override fun isLoggable(priority: Int, tag: String?): Boolean {
            return BuildConfig.DEBUG
      }
})

And that's where the problem lies
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant