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 logback classic #103

Merged
merged 1 commit into from
Jul 2, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.vitruv.change.changederivation
package tools.vitruv.change.changederivation.persistence

import java.io.IOException
import java.io.InputStream
Expand Down Expand Up @@ -41,7 +41,7 @@ class DeltaBasedResource extends ResourceImpl {
}

override doSave(OutputStream outputStream, Map<?, ?> options) throws IOException {
val deltaChanges = new DefaultStateBasedChangeResolutionStrategy().getChangeSequenceForCreated(this).EChanges;
val deltaChanges = new tools.vitruv.change.changederivation.DefaultStateBasedChangeResolutionStrategy().getChangeSequenceForCreated(this).EChanges;
val resourceSet = withGlobalFactories(new ResourceSetImpl());
val resource = resourceSet.createResource(this.URI);
resource.getContents().addAll(deltaChanges)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.vitruv.change.changederivation
package tools.vitruv.change.changederivation.persistence

import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.resource.Resource
Expand Down
3 changes: 0 additions & 3 deletions bundles/tools.vitruv.testutils/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ Import-Package: org.junit.jupiter.api.extension,
org.junit.jupiter.params.converter,
org.junit.platform.commons.support
Require-Bundle: org.apache.log4j,
org.slf4j.api,
ch.qos.logback.classic,
ch.qos.logback.core,
org.hamcrest.core,
org.eclipse.core.resources,
org.eclipse.core.runtime,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package tools.vitruv.testutils

import ch.qos.logback.classic.Level
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import edu.kit.ipd.sdq.activextendannotations.Lazy
import org.apache.log4j.ConsoleAppender
import org.apache.log4j.PatternLayout
import org.junit.jupiter.api.^extension.BeforeAllCallback
import org.junit.jupiter.api.^extension.ExtensionContext
import org.slf4j.LoggerFactory

import static org.apache.log4j.Level.*
import static org.apache.log4j.Logger.getRootLogger
import static org.slf4j.Logger.ROOT_LOGGER_NAME

import static extension org.apache.log4j.Logger.getLogger
import java.util.List
Expand All @@ -31,7 +27,6 @@ class TestLogging implements BeforeAllCallback {

override beforeAll(ExtensionContext context) throws Exception {
configureLog4J()
configureSlf4J()
}

def private static configureLog4J() {
Expand All @@ -41,28 +36,4 @@ class TestLogging implements BeforeAllCallback {
VITRUV_LOG_ROOTS.forEach [logger.level = toLevel(desiredLogLevel, WARN)]
TestProjectManager.logger.level = INFO
}

def private static configureSlf4J() {
val root = LoggerFactory.ILoggerFactory.getLogger(ROOT_LOGGER_NAME)
if (root instanceof ch.qos.logback.classic.Logger) {
val consoleAppender = new ch.qos.logback.core.ConsoleAppender => [
name = "console"
context = root.loggerContext
encoder = new PatternLayoutEncoder => [
context = root.loggerContext
pattern = LOG_PATTERN
start()
]
start()
]
root.detachAndStopAllAppenders()
root.level = Level.toLevel(desiredLogLevel, Level.ERROR)
root.addAppender(consoleAppender)
// there are currently (2021-02-12) no Vitruv loggers, but let's set this up anyway to be prepared
VITRUV_LOG_ROOTS.forEach [
(LoggerFactory.ILoggerFactory.getLogger(it) as ch.qos.logback.classic.Logger)
.level = Level.toLevel(desiredLogLevel, Level.WARN)
]
}
}
}
3 changes: 0 additions & 3 deletions features/tools.vitruv.testutils.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

<requires>
<import plugin="org.apache.log4j"/>
<import plugin="slf4j.api"/>
<import plugin="ch.qos.logback.classic"/>
<import plugin="ch.qos.logback.core"/>
<import plugin="org.junit.jupiter.api"/>
<import plugin="org.junit.jupiter.params"/>
<import plugin="org.junit.platform.commons"/>
Expand Down
9 changes: 0 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
<artifactId>tools.vitruv</artifactId>
<packaging>pom</packaging>

<dependencies>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
</dependencies>

<modules>
<module>releng/tools.vitruv.change.workflow</module>
<module>bundles</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ Import-Package: org.junit.jupiter.api,
Require-Bundle: org.eclipse.xtend.lib,
org.hamcrest.core,
tools.vitruv.testutils,
tools.vitruv.testutils.metamodels
tools.vitruv.testutils.metamodels,
edu.kit.ipd.sdq.commons.util.java,
edu.kit.ipd.sdq.commons.util.emf
Loading