Skip to content

Commit

Permalink
Set logging directory correctly when running in a client
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jun 17, 2013
1 parent f873581 commit 65c84f2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/common/me/nallar/tickprofiler/Log.java
Expand Up @@ -14,8 +14,11 @@
import java.util.logging.Logger;
import java.util.regex.Pattern;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLLog;
import me.nallar.tickprofiler.util.MappingUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.gui.GuiLogOutputHandler;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
Expand All @@ -29,7 +32,19 @@ public class Log {
};
private static Handler handler;
private static final int numberOfLogFiles = Integer.getInteger("tickprofiler.numberOfLogFiles", 5);
private static final File logFolder = new File("TickThreadingLogs");
private static final File logFolder;

static {
File logFolder_ = new File("TickProfilerLogs");
try {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
logFolder_ = new File(Minecraft.getMinecraftDir(), "TickProfilerLogs");
}
} catch (Exception ignored) {
}
logFolder = logFolder_;
}

private static Handler wrappedHandler;
private static final Handler handlerWrapper = new Handler() {
Pattern pattern = Pattern.compile("\\P{Print}");
Expand Down

0 comments on commit 65c84f2

Please sign in to comment.