Replace System.out with a Logger

This commit is contained in:
James Seibel
2021-05-31 14:11:58 -05:00
parent 3e8dbf7ac7
commit b488d21a14
3 changed files with 19 additions and 7 deletions
@@ -11,6 +11,7 @@ import java.util.concurrent.Executors;
import com.backsun.lod.objects.LodChunk;
import com.backsun.lod.objects.LodDimension;
import com.backsun.lod.objects.LodRegion;
import com.backsun.lod.proxy.ClientProxy;
/**
* This object handles creating LodRegions
@@ -113,15 +114,19 @@ public class LodDimensionFileHandler
// close the reader and delete the file.
br.close();
f.delete();
ClientProxy.LOGGER.info("LOD region file: \"" + fileName + "\" version: " + fileVersion + ", version requested: " + LOD_SAVE_FILE_VERSION + "\t" +
" File was outdated and has been deleted.");
return null;
}
else if(fileVersion > LOD_SAVE_FILE_VERSION)
{
// the file we are reading is an newer version,
// the file we are reading is a newer version,
// close the reader and ignore the file, we don't
// want to accidently delete anything the user may want.
br.close();
ClientProxy.LOGGER.info("LOD region file: \"" + fileName + "\" version: " + fileVersion + ", version requested: " + LOD_SAVE_FILE_VERSION + "\t" +
" File is newer than .");
return null;
}
@@ -151,9 +156,7 @@ public class LodDimensionFileHandler
// we were unable to create this chunk
// for whatever reason.
// skip to the next chunk
// TODO write this to the log
System.err.println(e.getMessage());
ClientProxy.LOGGER.warn(e.getMessage());
}
s = br.readLine();
@@ -288,7 +291,7 @@ public class LodDimensionFileHandler
}
catch(Exception e)
{
System.err.println("LOD file write error: " + e.getMessage());
ClientProxy.LOGGER.error("LOD file write error: " + e.getMessage());
}
}
@@ -247,7 +247,6 @@ public class LodDimension
// don't continue if the region can't be saved
if (!regionIsInRange(pos.x, pos.z))
{
//System.out.println(pos.x + " " + pos.z + " out of range");
return;
}
@@ -1,5 +1,8 @@
package com.backsun.lod.proxy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.backsun.lod.builders.LodBufferBuilder;
import com.backsun.lod.builders.LodBuilder;
import com.backsun.lod.objects.LodChunk;
@@ -21,10 +24,12 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
* and is the starting point for most of this program.
*
* @author James_Seibel
* @version 05-29-2021
* @version 05-31-2021
*/
public class ClientProxy
{
public static final Logger LOGGER = LogManager.getLogger();
private static LodWorld lodWorld = new LodWorld();
private static LodBuilder lodBuilder = new LodBuilder();
private static LodBufferBuilder lodBufferBuilder = new LodBufferBuilder(lodBuilder);
@@ -84,6 +89,11 @@ public class ClientProxy
}
// TODO for testing
// LodConfig.CLIENT.debugMode.set(false);
// LodConfig.CLIENT.lodDetail.set(LodDetail.DOUBLE);
// LodConfig.CLIENT.lodColorStyle.set(LodColorStyle.TOP);
// Note to self:
// if "unspecified" shows up in the pie chart, it is
// possibly because the amount of time between sections