what is the correct way of getting an instance of ...
# community-support
c
what is the correct way of getting an instance of gradle's slf4j logger wrapper in a plugin?
org.gradle.api.logging.Logger log = ... some call
I know I can get it off project, I'm just hoping that passing it around from there isn't the choice
e
just get your own logger, there's no need to use the project's
c
what's the call for the gradle interface though
gradles api version is not the same as slf4j
e
not sure what you mean by that, Gradle's Logger extends slf4j's Logger with
lifecycle
level but is otherwise the same thing
whether you use slf4j's
LoggerFactory.getLogger()
or Gradle's
Logging.getLogger()
, you'll end up with the same thing
c
but it doesn't have the same api. slf4j has no quiet method for example
the latter is what I was looking for
v
lifecycle and quiet are the ones that are Gradle specific levels, yes. But as ephemient said,
Logging.getLogger()
is a static method which you can use to get a Gradle logger.