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

Refactor logging #906

Conversation

rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Jul 13, 2024

  • Decouple logging from Logger object, which has an Android dependency. We use the standard Java java.util.logging.Logger in DAVx5, so there's no need for an Android dependency to get the logger.
  • Separate concerns: LogManager is now managing which handlers are active; the handlers do whatever belong to their responsibility (for instance the "Verbose logging" notification is now shown by the LogFileHandler)
  • Provide injection of Logger (gets Logger.getGlobal())
  • New preferred way of getting the logger is either
    • over injection: @Inject logger: Logger,
    • or without Android/app dependency: [j.u.l.]Logger.getGlobal()
    • or if the logger needs to be customized (for instance like in DavResourceFinder): [j.u.l.]Logger.getLogger(javaClass.name)

@rfc2822 rfc2822 self-assigned this Jul 13, 2024
@rfc2822 rfc2822 changed the title Re-factor logging Refactor logging Jul 13, 2024
@rfc2822 rfc2822 force-pushed the 900-logger-doesnt-additionally-log-to-logcat-when-verbose-logs-setting-is-on branch 2 times, most recently from 5f546e6 to 33c47af Compare July 13, 2024 15:13
@rfc2822 rfc2822 marked this pull request as ready for review July 13, 2024 15:13
@rfc2822 rfc2822 added the refactoring Internal improvement of existing functions label Jul 13, 2024
@rfc2822 rfc2822 force-pushed the 900-logger-doesnt-additionally-log-to-logcat-when-verbose-logs-setting-is-on branch from 33c47af to 9f7c171 Compare July 13, 2024 15:15
@rfc2822 rfc2822 force-pushed the 900-logger-doesnt-additionally-log-to-logcat-when-verbose-logs-setting-is-on branch from 9f7c171 to 8d9a3f6 Compare July 13, 2024 15:27
@rfc2822 rfc2822 merged commit be43d36 into main-ose Jul 13, 2024
8 checks passed
@rfc2822 rfc2822 deleted the 900-logger-doesnt-additionally-log-to-logcat-when-verbose-logs-setting-is-on branch July 13, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logger doesn't additionally log to logcat when "verbose logs" setting is on
1 participant