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

MBS-11239 Remove GradleLoggerPlugin usages #1297

Merged
merged 1 commit into from
Dec 2, 2021
Merged

MBS-11239 Remove GradleLoggerPlugin usages #1297

merged 1 commit into from
Dec 2, 2021

Conversation

sboishtyan
Copy link
Contributor

@sboishtyan sboishtyan commented Dec 1, 2021

I've added comment to places I think you should look

@@ -14,6 +14,7 @@ internal class BuildMetricsRunner(
*args.toTypedArray(),
"-Pavito.build.metrics.enabled=true",
"-Pavito.stats.enabled=false",
"-Pstatsd.test"
Copy link
Contributor Author

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
Copy link
Contributor Author

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)
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

@eugene-krivobokov eugene-krivobokov Dec 2, 2021

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 {
Copy link
Contributor Author

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)),
Copy link
Contributor Author

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

@sboishtyan sboishtyan merged commit 937f327 into develop Dec 2, 2021
@sboishtyan sboishtyan deleted the MBS-11239 branch December 2, 2021 09:27
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.

3 participants