-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix JaninoEvaluator issue/800, prepare release 1.5.4
- Loading branch information
Showing
9 changed files
with
102 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
logback-classic/src/main/java/ch/qos/logback/classic/boolex/MarkerList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Logback: the reliable, generic, fast and flexible logging framework. | ||
* Copyright (C) 1999-2024, QOS.ch. All rights reserved. | ||
* | ||
* This program and the accompanying materials are dual-licensed under | ||
* either the terms of the Eclipse Public License v1.0 as published by | ||
* the Eclipse Foundation | ||
* | ||
* or (per the licensee's choosing) | ||
* | ||
* under the terms of the GNU Lesser General Public License version 2.1 | ||
* as published by the Free Software Foundation. | ||
*/ | ||
|
||
package ch.qos.logback.classic.boolex; | ||
|
||
import org.slf4j.Marker; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A helper class to be used in conjunction with {@link ch.qos.logback.classic.boolex.JaninoEventEvaluator} | ||
* | ||
* @since 1.5.4 | ||
*/ | ||
public class MarkerList { | ||
|
||
List<Marker> markers; | ||
|
||
public MarkerList(List<Marker> markers) { | ||
this.markers = markers; | ||
} | ||
|
||
/** | ||
* Check whether this list contains a given marker. | ||
* | ||
* @param markerName | ||
* @return | ||
*/ | ||
public boolean contains(String markerName) { | ||
if(markerName == null || markerName.trim().length() == 0) | ||
return false; | ||
|
||
if(markers == null || markers.isEmpty()) | ||
return false; | ||
|
||
final boolean result = markers.stream().anyMatch( m -> m.contains(markerName)); | ||
return result; | ||
} | ||
|
||
/** | ||
* Return the first marker on the list, can be null. | ||
* | ||
* | ||
* @return the first marker on the list, can be null | ||
*/ | ||
public Marker getFirstMarker() { | ||
if(markers == null || markers.isEmpty()) { | ||
return null; | ||
} else { | ||
return markers.get(0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters