-
Notifications
You must be signed in to change notification settings - Fork 52
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
MBS-11239 Remove GradleLoggerPlugin usages #1297
Conversation
@@ -14,6 +14,7 @@ internal class BuildMetricsRunner( | |||
*args.toTypedArray(), | |||
"-Pavito.build.metrics.enabled=true", | |||
"-Pavito.stats.enabled=false", | |||
"-Pstatsd.test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because gradle logger debug is overhead
val buildTraceListener = BuildTraceListener( | ||
output = outputDir.file("build.trace").get().asFile, | ||
loggerFactory = loggerFactory | ||
logger = project.logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we really need logs we could use slf4j logger from Gradle or avito logger if that code is used from android runtime too
dos.writeBytes(message) | ||
} | ||
} catch (e: Exception) { | ||
logger.warn(message, e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move that handling to the client
@@ -14,11 +12,8 @@ import java.util.Collections | |||
|
|||
public class MockDispatcher( | |||
private val unmockedResponse: MockResponse = MockResponse().setResponseCode(418).setBody("Not mocked"), | |||
loggerFactory: LoggerFactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussable. We discuss that with @eugene-krivobokov and consider that if someone need debug info we should make it more obvious i.e. add a fun for that info
@@ -38,7 +33,7 @@ internal class SuspiciousTogglesCollector( | |||
.find { it.codeLine.contains("defaultValue") } | |||
|
|||
if (lastChangeCodeItem == null) { | |||
logger.critical("Error: ${jsonToggle.key}", NoSuchElementException(jsonToggle.key)) | |||
// TODO handle lastChangeCodeItem == null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eugene-krivobokov could we add a fail fast or we need a task to handle it properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just fail for now.
We need to delete this plugin. Unfortunately, it's broken and not worth fixing. See ON-122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used at Avito right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin is applied but tasks from it are not used anymore.
This is why we need to remove it from avito firstly and then remove it from Github.
import org.gradle.api.logging.Logging | ||
import org.gradle.internal.logging.slf4j.DefaultContextAwareTaskLogger | ||
|
||
public object Slf4jGradleLoggerFactory : LoggerFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For components, those are used from Gradle and Android runtimes.
public object Slf4jGradleLoggerFactory : LoggerFactory { | ||
override fun create(tag: String): Logger { | ||
return Slf4jGradleLogger( | ||
DefaultContextAwareTaskLogger(Logging.getLogger(Task::class.java)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It logs as Gradle logger
I've added comment to places I think you should look