logging for loading thread error

This commit is contained in:
austin 2025-05-29 12:20:33 -04:00
parent 70142a824d
commit 4d1a5fa8aa
3 changed files with 10 additions and 25 deletions

View File

@ -2055,6 +2055,7 @@ Fix viewport interaction with lod emitter service
Fix most tests
Rendering engine legacy code reorganization
Code cleanup work
Logging for loading thread failure

View File

@ -1,5 +1,7 @@
package electrosphere.engine.loadingthreads;
import electrosphere.logger.LoggerInterface;
/**
* Threads for loading engine state
*/
@ -100,7 +102,11 @@ public class LoadingThread extends Thread {
@Override
public void run(){
execSync(this.threadType, this.params);
try {
LoadingThread.execSync(this.threadType, this.params);
} catch(Throwable e){
LoggerInterface.loggerEngine.ERROR("Loading thread failed!", e);
}
isDone = true;
}

View File

@ -116,32 +116,10 @@ public class Logger {
* This should be used every time we throw any kind of error in the engine
* @param message The message to report
*/
public void ERROR(String message, Exception e){
public void ERROR(String message, Throwable e){
if(level == LogLevel.LOOP_DEBUG || level == LogLevel.DEBUG || level == LogLevel.INFO || level == LogLevel.WARNING || level == LogLevel.ERROR){
System.err.println(message);
ERROR(e);
}
}
/**
* Logs an error message.
* This should be used every time we throw any kind of error in the engine
* @param e The exception to report
*/
public void ERROR(Exception e){
if(level == LogLevel.LOOP_DEBUG || level == LogLevel.DEBUG || level == LogLevel.INFO || level == LogLevel.WARNING || level == LogLevel.ERROR){
e.printStackTrace();
}
}
/**
* Logs an error message.
* This should be used every time we throw any kind of error in the engine
* @param e The exception to report
*/
public void ERROR(Error e){
if(level == LogLevel.LOOP_DEBUG || level == LogLevel.DEBUG || level == LogLevel.INFO || level == LogLevel.WARNING || level == LogLevel.ERROR){
e.printStackTrace();
this.ERROR(e);
}
}