File tree Expand file tree Collapse file tree 2 files changed +10
-20
lines changed
src/main/java/com/falsepattern/lib/internal/impl/config/event Expand file tree Collapse file tree 2 files changed +10
-20
lines changed Original file line number Diff line number Diff line change 28
28
import com .falsepattern .lib .config .event .ConfigValidationFailureEvent ;
29
29
import com .falsepattern .lib .internal .FPLog ;
30
30
import com .falsepattern .lib .internal .config .ConfigEngineConfig ;
31
- import com .falsepattern .lib .internal .config .MiscConfig ;
32
31
import com .falsepattern .lib .text .FormattedText ;
33
32
import com .falsepattern .lib .toasts .GuiToast ;
34
33
import com .falsepattern .lib .toasts .SimpleToast ;
@@ -75,6 +74,9 @@ public void onConfigSyncFinished(ConfigSyncEvent.End e) {
75
74
false ,
76
75
5000 ));
77
76
}
77
+ if (ConfigEngineConfig .CONFIG_SYNC_SUCCESS_LOGGING != ConfigEngineConfig .LoggingLevel .None ) {
78
+ FPLog .LOG .info ("Synced config: {}:{}" , cfg .modid (), cfg .category ());
79
+ }
78
80
} else {
79
81
if (ConfigEngineConfig .CONFIG_SYNC_FAILURE_LOGGING == ConfigEngineConfig .LoggingLevel .LogAndToast ) {
80
82
GuiToast .add (new SimpleToast (ToastBG .TOAST_DARK ,
@@ -86,6 +88,13 @@ public void onConfigSyncFinished(ConfigSyncEvent.End e) {
86
88
false ,
87
89
5000 ));
88
90
}
91
+ if (ConfigEngineConfig .CONFIG_SYNC_FAILURE_LOGGING != ConfigEngineConfig .LoggingLevel .None ) {
92
+ FPLog .LOG .error ("Failed to sync config: {}:{}" , cfg .modid (), cfg .category ());
93
+ val t = e .error ;
94
+ if (t != null ) {
95
+ FPLog .LOG .error (t .getMessage (), t );
96
+ }
97
+ }
89
98
90
99
}
91
100
}
Original file line number Diff line number Diff line change @@ -57,23 +57,4 @@ public void onValidationErrorLog(ConfigValidationFailureEvent e) {
57
57
e .logWarn ();
58
58
}
59
59
}
60
-
61
- @ SubscribeEvent
62
- public void onConfigSyncFinished (ConfigSyncEvent .End e ) {
63
- if (e .successful ) {
64
- if (ConfigEngineConfig .CONFIG_SYNC_SUCCESS_LOGGING != ConfigEngineConfig .LoggingLevel .None ) {
65
- val cfg = e .configClass .getAnnotation (Config .class );
66
- FPLog .LOG .info ("Synced config: {}:{}" , cfg .modid (), cfg .category ());
67
- }
68
- } else {
69
- if (ConfigEngineConfig .CONFIG_SYNC_FAILURE_LOGGING != ConfigEngineConfig .LoggingLevel .None ) {
70
- val cfg = e .configClass .getAnnotation (Config .class );
71
- FPLog .LOG .error ("Failed to sync config: {}:{}" , cfg .modid (), cfg .category ());
72
- val t = e .error ;
73
- if (t != null ) {
74
- FPLog .LOG .error (t .getMessage (), t );
75
- }
76
- }
77
- }
78
- }
79
60
}
You can’t perform that action at this time.
0 commit comments