Skip to content

Commit

Permalink
[Logging] use only log4j-2 Loggers and only depend on api (#254)
Browse files Browse the repository at this point in the history
Also clean up logging dependencies.
  • Loading branch information
HannesWell committed Sep 3, 2021
1 parent f2e152a commit e3606eb
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 46 deletions.
14 changes: 14 additions & 0 deletions symja_android_library/matheclipse-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@
<artifactId>encoder</artifactId>
</dependency>

<!-- logging dependencies -->

<dependency> <!-- provide the logging-framework implementation -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>runtime</scope>
</dependency>

<dependency> <!-- bind slf4j to log4j-2-core -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>runtime</scope>
</dependency>

</dependencies>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
*/
package com.twosigma.beakerx.symjamma.evaluator;

import java.util.concurrent.Callable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.evaluator.JobDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.Callable;

class SymjaMMAWorkerThread implements Callable<TryResult> {

private static final Logger logger =
LoggerFactory.getLogger(SymjaMMAWorkerThread.class.getName());
private static final Logger logger = LogManager.getLogger(SymjaMMAWorkerThread.class.getName());
private final JobDescriptor j;
protected SymjaMMAEvaluator symjaEvaluator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
*/
package com.twosigma.beakerx.symjamma.widgets;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.twosigma.beakerx.widget.InteractiveBase;
import com.twosigma.beakerx.widget.Label;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Interactive extends InteractiveBase {

private static Label label;

private static final Logger logger = LoggerFactory.getLogger(Interactive.class);
private static final Logger logger = LogManager.getLogger(Interactive.class);

// @SuppressWarnings("unchecked")
// public static void interact(MethodClosure function, Object... parameters) {
Expand Down
13 changes: 1 addition & 12 deletions symja_android_library/matheclipse-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,7 @@

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<artifactId>log4j-api</artifactId>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeMap;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import org.apache.log4j.Logger;

/**
* A sorted set of elements with multiple occurrences, sorted smallest elements first. Sorting is
Expand All @@ -23,7 +24,7 @@ public class SortedMultiset_BottomUp<T extends Comparable<T>> extends TreeMap<T,
private static final long serialVersionUID = -6604624351619809213L;

@SuppressWarnings("unused")
private static final Logger LOG = Logger.getLogger(SortedMultiset_BottomUp.class);
private static final Logger LOG = LogManager.getLogger(SortedMultiset_BottomUp.class);

/**
* Constructor for an empty multiset, sorted smallest elements first. This sort order is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.matheclipse.core.numbertheory;

import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand All @@ -10,6 +8,8 @@
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeMap;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
* A sorted set of elements with multiple occurrences, sorted biggest elements first. Sorting is due
Expand All @@ -24,7 +24,7 @@ public class SortedMultiset_TopDown<T extends Comparable<T>> extends TreeMap<T,
private static final long serialVersionUID = -6604624351619809213L;

@SuppressWarnings("unused")
private static final Logger LOG = Logger.getLogger(SortedMultiset_TopDown.class);
private static final Logger LOG = LogManager.getLogger(SortedMultiset_TopDown.class);

/**
* Constructor for an empty multiset, sorted biggest elements first. This sort order is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
public class ExprTermOrderByName {

// private static final Logger logger = Logger.getLogger(ExprTermOrderByName.class);
// private static final Logger logger = LogManager.getLogger(ExprTermOrderByName.class);

/** ExprTermOrder named LEX. */
public static final ExprTermOrder LEX = new ExprTermOrder(ExprTermOrder.LEX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class SymbolicTermOrderByName {

// private static final Logger logger = Logger.getLogger(ExprTermOrderByName.class);
// private static final Logger logger = LogManager.getLogger(ExprTermOrderByName.class);

/** ExpVectorTermOrder named LEX. */
public static final SymbolicTermOrder LEX = new SymbolicTermOrder(SymbolicTermOrder.LEX);
Expand Down
13 changes: 1 addition & 12 deletions symja_android_library/matheclipse-external/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,7 @@

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<artifactId>log4j-api</artifactId>
</dependency>

</dependencies>
Expand Down
7 changes: 7 additions & 0 deletions symja_android_library/matheclipse-gpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
<version>${project.version}</version>
</dependency>

<!-- logging dependencies -->

<dependency> <!-- bridge from log4j-1 to log4j-2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
14 changes: 14 additions & 0 deletions symja_android_library/matheclipse-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@
<artifactId>poi-ooxml</artifactId>
</dependency>

<!-- logging dependencies -->

<dependency> <!-- provide the logging-framework implementation -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>runtime</scope>
</dependency>

<dependency> <!-- bind slf4j to log4j-2-core -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>runtime</scope>
</dependency>

<!-- test dependencies -->

<dependency>
Expand Down
18 changes: 12 additions & 6 deletions symja_android_library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,22 +301,28 @@

<!-- logging dependencies -->

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.2</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.2</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.32</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.13.2</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.32</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.13.2</version>
</dependency>

</dependencies>
Expand Down

0 comments on commit e3606eb

Please sign in to comment.