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

Remove SLF4J and move to log4j api #112

Merged
merged 1 commit into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {
implementation(libs.csv)
implementation(libs.asm.util)
implementation(libs.serialization)
implementation(libs.logging.impl)
implementation(libs.jansi)
implementation(libs.juniversalchardet)
implementation(libs.configurate.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package org.sourcegrade.jagr.core

import com.google.inject.AbstractModule
import com.google.inject.multibindings.Multibinder
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.Criterion
import org.sourcegrade.jagr.api.rubric.CriterionHolderPointCalculator
import org.sourcegrade.jagr.api.rubric.GradeResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.sourcegrade.jagr.core.compiler.java

import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.testing.CompileResult
import org.sourcegrade.jagr.core.compiler.ResourceCollector
import org.sourcegrade.jagr.core.compiler.RuntimeContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.compiler.java

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.core.compiler.ResourceCollectorImpl
import org.sourcegrade.jagr.core.compiler.ResourceExtractor
import org.sourcegrade.jagr.core.compiler.RuntimeContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.executor

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.testing.ClassTransformerOrder
import org.sourcegrade.jagr.api.testing.Submission
import org.sourcegrade.jagr.core.compiler.InfoJsonResourceExtractor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.executor

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.launcher.executor.GradingQueue
import org.sourcegrade.jagr.launcher.io.GradingBatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package org.sourcegrade.jagr.core.executor

import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.testing.Submission
import org.sourcegrade.jagr.launcher.executor.GradingQueue
import org.sourcegrade.jagr.launcher.executor.GradingRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package org.sourcegrade.jagr.core.executor

import com.google.inject.Inject
import org.apache.logging.log4j.Logger
import org.opentest4j.AssertionFailedError
import org.slf4j.Logger
import org.sourcegrade.jagr.core.executor.TimeoutHandler.checkTimeout
import org.sourcegrade.jagr.core.transformer.CommonClassTransformer
import org.sourcegrade.jagr.launcher.env.Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package org.sourcegrade.jagr.core.export.rubric
import com.google.inject.Inject
import org.apache.commons.csv.CSVFormat
import org.apache.commons.csv.CSVPrinter
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.GradedCriterion
import org.sourcegrade.jagr.api.rubric.GradedRubric
import org.sourcegrade.jagr.api.rubric.PointRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.google.inject.Inject
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.GradedCriterion
import org.sourcegrade.jagr.api.rubric.GradedRubric
import org.sourcegrade.jagr.api.rubric.PointRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import com.google.common.reflect.ClassPath
import com.google.inject.Inject
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.testing.SourceFile
import org.sourcegrade.jagr.api.testing.Submission
import org.sourcegrade.jagr.core.testing.GraderJarImpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.extra

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.launcher.env.Config
import org.sourcegrade.jagr.launcher.io.ExtrasManager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.extra

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.launcher.env.Config
import java.io.File
import java.util.zip.ZipEntry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlinx.serialization.SerializationException
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.launcher.env.Config
import org.sourcegrade.jagr.launcher.io.SubmissionInfo
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
package org.sourcegrade.jagr.core.rubric

import com.google.inject.Inject
import org.apache.logging.log4j.Logger
import org.junit.platform.engine.TestExecutionResult
import org.junit.platform.engine.TestSource
import org.junit.platform.engine.support.descriptor.ClassSource
import org.junit.platform.engine.support.descriptor.MethodSource
import org.junit.platform.launcher.TestIdentifier
import org.opentest4j.AssertionFailedError
import org.slf4j.Logger
import org.sourcegrade.jagr.api.rubric.JUnitTestRef
import java.lang.reflect.Method
import java.util.concurrent.Callable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.sourcegrade.jagr.core.rubric.grader

import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.Criterion
import org.sourcegrade.jagr.api.rubric.GradeResult
import org.sourcegrade.jagr.api.rubric.Grader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.rubric.grader

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.Grader

class GraderFactoryImpl @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.sourcegrade.jagr.core.testing

import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.RubricForSubmission
import org.sourcegrade.jagr.api.rubric.RubricProvider
import org.sourcegrade.jagr.api.rubric.TestForSubmission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
package org.sourcegrade.jagr.core.testing

import com.google.inject.Inject
import org.apache.logging.log4j.Logger
import org.junit.platform.commons.JUnitException
import org.junit.platform.engine.discovery.ClassSelector
import org.junit.platform.engine.discovery.DiscoverySelectors
import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder
import org.junit.platform.launcher.core.LauncherFactory
import org.junit.platform.launcher.listeners.SummaryGeneratingListener
import org.slf4j.Logger
import org.sourcegrade.jagr.api.testing.Submission
import org.sourcegrade.jagr.api.testing.TestCycle
import org.sourcegrade.jagr.core.compiler.java.RuntimeClassLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.core.testing

import com.google.inject.Inject
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.api.rubric.GradedRubric
import org.sourcegrade.jagr.api.rubric.RubricProvider
import org.sourcegrade.jagr.api.testing.Submission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

package org.sourcegrade.jagr.core.testing

import org.apache.logging.log4j.Logger
import org.junit.platform.engine.TestExecutionResult
import org.junit.platform.launcher.TestExecutionListener
import org.junit.platform.launcher.TestIdentifier
import org.slf4j.Logger
import org.sourcegrade.jagr.api.testing.TestStatusListener
import org.sourcegrade.jagr.launcher.io.SubmissionInfo
import java.util.Collections
Expand Down
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ junit-core = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit"
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
junit-launcher = "org.junit.platform:junit-platform-launcher:1.9.1"
juniversalchardet = "com.github.albfernandez:juniversalchardet:2.4.0"
logging-api = "org.slf4j:slf4j-api:2.0.2"
logging-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" }
logging-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }
logging-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" }
serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0"

[bundles]
Expand Down
1 change: 0 additions & 1 deletion launcher/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies {
implementation(libs.configurate.hocon)
implementation(libs.annotations)
implementation(libs.serialization)
implementation(libs.logging.impl)
implementation(libs.logging.core)
kapt(libs.logging.core)
implementation(kotlin("reflect"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.sourcegrade.jagr.launcher.env

import com.google.inject.Injector
import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import org.sourcegrade.jagr.launcher.executor.GradingQueue
import org.sourcegrade.jagr.launcher.executor.RuntimeGrader
import org.sourcegrade.jagr.launcher.io.ExtrasManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

package org.sourcegrade.jagr.launcher.env

import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import org.spongepowered.configurate.CommentedConfigurationNode
import org.spongepowered.configurate.hocon.HoconConfigurationLoader
import org.spongepowered.configurate.loader.ConfigurationLoader
Expand All @@ -33,6 +33,6 @@ interface LaunchConfiguration {
object Standard : LaunchConfiguration {
override val configurationLoader: ConfigurationLoader<CommentedConfigurationNode> =
HoconConfigurationLoader.builder().file(File("jagr.conf")).build()
override val logger: Logger = LoggerFactory.getLogger("Jagr")
override val logger: Logger = LogManager.getLogger("Jagr")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.apache.logging.log4j.Logger
import org.apache.logging.log4j.core.LogEvent
import org.slf4j.Logger
import org.sourcegrade.jagr.launcher.env.Environment
import org.sourcegrade.jagr.launcher.env.Jagr
import org.sourcegrade.jagr.launcher.env.logger
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/sourcegrade/jagr/Files.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.sourcegrade.jagr

import org.slf4j.Logger
import org.apache.logging.log4j.Logger
import java.io.File

fun File.ensure(logger: Logger? = null, logInfo: Boolean = true): File? {
Expand Down