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 2828import com .falsepattern .lib .config .event .ConfigValidationFailureEvent ;
2929import com .falsepattern .lib .internal .FPLog ;
3030import com .falsepattern .lib .internal .config .ConfigEngineConfig ;
31- import com .falsepattern .lib .internal .config .MiscConfig ;
3231import com .falsepattern .lib .text .FormattedText ;
3332import com .falsepattern .lib .toasts .GuiToast ;
3433import com .falsepattern .lib .toasts .SimpleToast ;
@@ -75,6 +74,9 @@ public void onConfigSyncFinished(ConfigSyncEvent.End e) {
7574 false ,
7675 5000 ));
7776 }
77+ if (ConfigEngineConfig .CONFIG_SYNC_SUCCESS_LOGGING != ConfigEngineConfig .LoggingLevel .None ) {
78+ FPLog .LOG .info ("Synced config: {}:{}" , cfg .modid (), cfg .category ());
79+ }
7880 } else {
7981 if (ConfigEngineConfig .CONFIG_SYNC_FAILURE_LOGGING == ConfigEngineConfig .LoggingLevel .LogAndToast ) {
8082 GuiToast .add (new SimpleToast (ToastBG .TOAST_DARK ,
@@ -86,6 +88,13 @@ public void onConfigSyncFinished(ConfigSyncEvent.End e) {
8688 false ,
8789 5000 ));
8890 }
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+ }
8998
9099 }
91100 }
Original file line number Diff line number Diff line change @@ -57,23 +57,4 @@ public void onValidationErrorLog(ConfigValidationFailureEvent e) {
5757 e .logWarn ();
5858 }
5959 }
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- }
7960}
You can’t perform that action at this time.
0 commit comments