Skip to content

add flogger backend dependency #517

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

Merged
merged 2 commits into from
Feb 4, 2022

Conversation

benkonz
Copy link
Contributor

@benkonz benkonz commented Jan 20, 2022

I was getting a

No logging platforms found in while using google flogger logging ClassNotFoundException: com.google.common.flogger.backend.system.DefaultPlatform

error when running the tests locally in ratatool. It looks like we need to add a logging backend to ratatool in order to have flogger function properly. According to the flogger docs, https://github.com/google/flogger#1-add-the-dependencies-on-flogger, we need to add https://mvnrepository.com/artifact/com.google.flogger/flogger-system-backend/0.7.4 to build.sbt.

I set the scope to test in order to avoid adding dependencies for our users binary.

@benkonz benkonz force-pushed the add-flogger-backend-dependency branch from 64ab401 to c1594b5 Compare January 20, 2022 20:17
@codecov
Copy link

codecov bot commented Jan 20, 2022

Codecov Report

Merging #517 (c265521) into master (67dacd2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #517   +/-   ##
=======================================
  Coverage   69.63%   69.63%           
=======================================
  Files          36       36           
  Lines        1541     1541           
  Branches      133      133           
=======================================
  Hits         1073     1073           
  Misses        468      468           
Flag Coverage Δ
ratatoolCli 2.99% <ø> (ø)
ratatoolCommon ∅ <ø> (∅)
ratatoolDiffy 31.79% <ø> (ø)
ratatoolExamples 17.74% <ø> (ø)
ratatoolSampling 59.93% <ø> (ø)
ratatoolScalacheck 81.53% <ø> (ø)
ratatoolShapeless 5.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67dacd2...c265521. Read the comment docs.

Copy link
Contributor

@idreeskhan idreeskhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine to merge this to unblock for now but the fact that I don't understand what is going on worries me

build.sbt Outdated
@@ -180,7 +181,8 @@ lazy val ratatoolSampling = project
"com.twitter" %% "algebird-core" % algebirdVersion,
"joda-time" % "joda-time" % jodaTimeVersion,
"org.scalacheck" %% "scalacheck" % scalaCheckVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
"com.google.flogger" % "flogger-system-backend" % floggerVersion % "test"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the issues occurs in ParquetIOTest can we move this dep to ratatool-extras

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs for flogger say that "the dependency on flogger-system-backend is only required to be included when the binary is run", so I think there is a transitive dependency that is using flogger, but is excluding flogger-backend. Since we aren't supplying a logging backend, flogger is defaulting to throwing an exception.

The strange thing is that you weren't able to replicate it and the tests pass on CI.

@idreeskhan
Copy link
Contributor

Yea that's what I'm referring to. My gut says there's a better way to fix this than adding this dep

@benkonz
Copy link
Contributor Author

benkonz commented Jan 21, 2022

Yea that's what I'm referring to. My gut says there's a better way to fix this than adding this dep

It looks like these tests call ParquetIO.writeToFile, which calls this, which calls this, which has private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();, I'm not sure of an alternative other than deleting the test files

@benkonz benkonz force-pushed the add-flogger-backend-dependency branch from 45baa4c to c265521 Compare February 4, 2022 18:20
@idreeskhan idreeskhan merged commit f64595b into spotify:master Feb 4, 2022
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

Successfully merging this pull request may close these issues.

2 participants