File tree Expand file tree Collapse file tree 6 files changed +9
-26
lines changed
src/main/java/xyz/theprogramsrc/supercoreapi Expand file tree Collapse file tree 6 files changed +9
-26
lines changed Original file line number Diff line number Diff line change 1
1
## v4.2.13 Changelog:
2
2
```
3
- * Bungee Bug Fixes
3
+ * Moved Log Filter register method to the LogsFilter class
4
4
```
5
5
6
6
## v4.2.12 Changelog:
Original file line number Diff line number Diff line change 6
6
7
7
<groupId >xyz.theprogramsrc</groupId >
8
8
<artifactId >SuperCoreAPI</artifactId >
9
- <version >4.2.13_BETA </version >
9
+ <version >4.2.13_BETA2 </version >
10
10
<packaging >jar</packaging >
11
11
12
12
<name >SuperCoreAPI</name >
Original file line number Diff line number Diff line change 1
1
package xyz .theprogramsrc .supercoreapi ;
2
2
3
- import xyz .theprogramsrc .supercoreapi .global .LogsFilter ;
4
3
import xyz .theprogramsrc .supercoreapi .global .data .PluginDataStorage ;
5
4
import xyz .theprogramsrc .supercoreapi .global .dependencies .DependencyManager ;
6
5
import xyz .theprogramsrc .supercoreapi .global .translations .TranslationManager ;
@@ -154,12 +153,6 @@ default void addDisableHook(Runnable runnable){
154
153
*/
155
154
void emergencyStop ();
156
155
157
- /**
158
- * Registers a log filter
159
- * @param logsFilter the filter
160
- */
161
- void registerLogFilter (LogsFilter logsFilter );
162
-
163
156
/**
164
157
* Gets the plugin data storage
165
158
* @return the plugin data storage
Original file line number Diff line number Diff line change 9
9
import xyz .theprogramsrc .supercoreapi .bungee .storage .Settings ;
10
10
import xyz .theprogramsrc .supercoreapi .bungee .utils .BungeeUtils ;
11
11
import xyz .theprogramsrc .supercoreapi .bungee .utils .tasks .BungeeTasks ;
12
- import xyz .theprogramsrc .supercoreapi .global .LogsFilter ;
13
12
import xyz .theprogramsrc .supercoreapi .global .data .PluginDataStorage ;
14
13
import xyz .theprogramsrc .supercoreapi .global .dependencies .Dependencies ;
15
14
import xyz .theprogramsrc .supercoreapi .global .dependencies .DependencyManager ;
@@ -216,10 +215,4 @@ public LinkedList<Exception> getLastErrors() {
216
215
public void addError (Exception e ){
217
216
this .errors .add (e );
218
217
}
219
-
220
- @ Override
221
- public void registerLogFilter (LogsFilter logsFilter ){
222
- org .apache .logging .log4j .core .Logger consoleLogger = ((org .apache .logging .log4j .core .Logger ) org .apache .logging .log4j .LogManager .getRootLogger ());
223
- consoleLogger .addFilter (logsFilter );
224
- }
225
218
}
Original file line number Diff line number Diff line change 1
1
package xyz .theprogramsrc .supercoreapi .global ;
2
2
3
3
import org .apache .logging .log4j .Level ;
4
+ import org .apache .logging .log4j .LogManager ;
4
5
import org .apache .logging .log4j .Marker ;
5
6
import org .apache .logging .log4j .core .LogEvent ;
6
7
import org .apache .logging .log4j .core .Logger ;
@@ -35,6 +36,11 @@ private Result process(String message){
35
36
return Result .NEUTRAL ;
36
37
}
37
38
39
+ public void register (){
40
+ Logger consoleLogger = ((Logger ) LogManager .getRootLogger ());
41
+ consoleLogger .addFilter (this );
42
+ }
43
+
38
44
@ Override
39
45
public Result filter (LogEvent event ) {
40
46
return this .process (event .getMessage ().getFormattedMessage ());
@@ -63,7 +69,7 @@ public String[] getExtraRequirements(){
63
69
return new String [0 ];
64
70
}
65
71
66
- public static enum FilterResult {
72
+ public enum FilterResult {
67
73
DENY ,
68
74
NEUTRAL ,
69
75
NONE
Original file line number Diff line number Diff line change 1
1
package xyz .theprogramsrc .supercoreapi .spigot ;
2
2
3
- import org .apache .logging .log4j .LogManager ;
4
- import org .apache .logging .log4j .core .Logger ;
5
3
import org .bukkit .configuration .ConfigurationSection ;
6
4
import org .bukkit .event .HandlerList ;
7
5
import org .bukkit .event .Listener ;
8
6
import org .bukkit .plugin .java .JavaPlugin ;
9
7
import xyz .theprogramsrc .supercoreapi .SuperPlugin ;
10
8
import xyz .theprogramsrc .supercoreapi .SuperUtils ;
11
- import xyz .theprogramsrc .supercoreapi .global .LogsFilter ;
12
9
import xyz .theprogramsrc .supercoreapi .global .data .PluginDataStorage ;
13
10
import xyz .theprogramsrc .supercoreapi .global .dependencies .Dependencies ;
14
11
import xyz .theprogramsrc .supercoreapi .global .dependencies .DependencyManager ;
@@ -309,10 +306,4 @@ public LinkedList<Exception> getLastErrors() {
309
306
public void addError (Exception e ){
310
307
this .errors .add (e );
311
308
}
312
-
313
- @ Override
314
- public void registerLogFilter (LogsFilter logsFilter ){
315
- Logger consoleLogger = (Logger ) LogManager .getRootLogger ();
316
- consoleLogger .addFilter (logsFilter );
317
- }
318
309
}
You can’t perform that action at this time.
0 commit comments