Mis à jour Logger + javadoc

This commit is contained in:
galaxyoyo 2015-01-07 17:48:53 +01:00
parent b44e0e6cc5
commit 029801e2e8
3 changed files with 29 additions and 4 deletions

View File

@ -12,6 +12,7 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>

View File

@ -1,8 +1,10 @@
/** /**
* * @author galaxyoyo
*/ */
package galaxyoyo.unknown.client.main; package galaxyoyo.unknown.client.main;
import galaxyoyo.unknown.frame.MainFrame;
import java.io.IOException; import java.io.IOException;
import joptsimple.OptionParser; import joptsimple.OptionParser;
@ -17,8 +19,8 @@ import org.apache.logging.log4j.core.appender.FileAppender;
import org.apache.logging.log4j.core.layout.PatternLayout; import org.apache.logging.log4j.core.layout.PatternLayout;
/** /**
* @author galaxyoyo
* Class principale qui lance le jeu * Class principale qui lance le jeu
* @author galaxyoyo
* @see #main(String...) * @see #main(String...)
*/ */
public class Main public class Main
@ -50,7 +52,9 @@ public class Main
Logger LOGGER = (Logger) LogManager.getRootLogger(); Logger LOGGER = (Logger) LogManager.getRootLogger();
ConsoleAppender console = ConsoleAppender.newBuilder().setLayout(PatternLayout.newBuilder().withPattern("[%d{dd/MM/yyyy}] [%d{HH:mm:ss}] [%t] [%c] [%p] %m%n").build()).setName("Console").build(); ConsoleAppender console = ConsoleAppender.newBuilder().setLayout(PatternLayout.newBuilder().withPattern("[%d{dd/MM/yyyy}] [%d{HH:mm:ss}] [%t] [%c] [%p] %m%n").build()).setName("Console").build();
FileAppender file = FileAppender.createAppender("Console.log", "false", "false", "File", "true", "true", "true", "8192", console.getLayout(), null, "false", "false", null); FileAppender file = FileAppender.createAppender("Console.log", "false", "false", "File", "true", "true", "true", "8192", PatternLayout.newBuilder().withPattern("[%d{dd/MM/yyyy}] [%d{HH:mm:ss}] [%t] [%c] [%p] %m%n").build(), null, "false", "false", null);
console.start();
file.start();
LOGGER.addAppender(console); LOGGER.addAppender(console);
LOGGER.addAppender(file); LOGGER.addAppender(file);
LOGGER.setLevel(Level.INFO); LOGGER.setLevel(Level.INFO);
@ -87,7 +91,7 @@ public class Main
if (DEBUG) if (DEBUG)
{ {
LOGGER.setLevel(Level.DEBUG); LOGGER.setLevel(Level.ALL);
} }
} }
@ -96,11 +100,24 @@ public class Main
launchEditMode(); launchEditMode();
return; return;
} }
launchFrame();
}
/**
* Lance la fen&ecirc;tre principale
* @see #main(String...)
* @see #launchEditMode()
*/
private static void launchFrame()
{
MainFrame.getInstance().setVisible(true);
} }
/** /**
* Permet de lancer l'&eacute;diteur de carte * Permet de lancer l'&eacute;diteur de carte
* @see #main(String...) * @see #main(String...)
* @see #launchFrame()
* @since 0.1-aplha * @since 0.1-aplha
*/ */
private static void launchEditMode() private static void launchEditMode()

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration package="log4j.test" status="INFO">
<Loggers>
<Root level="INFO">
</Root>
</Loggers>
</Configuration>