api / org.gradle.api.invocation / Gradle / useLogger

useLogger

abstract fun useLogger(logger: Any): Unit

Uses the given object as a logger. The logger object may implement any of the listener interfaces supported by #addListener(Object).

Each listener interface has exactly one associated logger. When you call this method with a logger of a given listener type, the new logger will replace whichever logger is currently associated with the listener type. This allows you to selectively replace the standard logging which Gradle provides with your own implementation, for certain types of events.

Parameters

logger - The logger to use.