Commit a3303303 authored by Fardale's avatar Fardale

Log system log4j + example in Igniter_Main.java

parent 2c6a98dd
......@@ -5,6 +5,9 @@ bin/*
docs/*
doc.html
# Fichier temp vim
*.swp
target
*.class
build
......
......@@ -3,7 +3,9 @@
# Program packages and files
# - The packages should be the path inside your src directory. eg: package1 package2/package3
PACKAGEDIRS = ${shell find . -iname '*.java' | sed 's/[^/]*.java//' | sed 's/.\///' | sort -g | uniq}
PACKAGEDIRS = ${shell find . -iname '*.java' | sed 's/\.\/\|[^/]*.java//g' | sort -g | uniq}
#TESTCLASS = ${shell find . -name *Test.java | sed 's/.\/src\/\|.java//g' | sed 's/\//./g'}
# Java compiler
JAVAC = javac
......@@ -18,10 +20,11 @@ BIN = bin/
SRC = src/
# The lib directory
LIB = lib/*
LIB = lib/
# Java compiler flags
JAVAFLAGS = -g -d $(BIN) -cp $(SRC):$(LIB) -target $(JVM) -source $(JVM)
JAVAFLAGS = -g -d $(BIN) -cp $(SRC):$(LIB)* -target $(JVM) -source $(JVM)
WARNINGFLAGS = -Xlint:all,-unchecked,-serial
# Creating a .class file
COMPILE = $(JAVAC) $(JAVAFLAGS)
......@@ -47,6 +50,8 @@ IMAGEFILES = $(wildcard $(SRC)$(IMG)*.png $(SRC)$(IMG)*.gif $(SRC)$(IMG)*.txt)
all : $(addprefix $(BIN), $(CLASS_FILES))
@cp -r $(addprefix $(SRC)$(IMG), $(IMAGEDIRS)) $(IMAGEFILES) $(BIN)$(IMG)
@cp -r $(LIB) $(BIN)
@cp src/log4j.properties bin/
# The line describing the action starts with <TAB>
$(BIN)%.class : $(SRC)%.java
......@@ -55,7 +60,7 @@ $(BIN)%.class : $(SRC)%.java
$(COMPILE) $<
buildplay: all
cd bin/; java graphics.guiSkeleton.Igniter_Main
cd bin/; java -cp $(LIB)*:. graphics.guiSkeleton.Igniter_Main
clean :
rm -rf $(BIN)
......
......@@ -4,6 +4,10 @@ import core.abilities.AbilityPackageInitialiser;
import core.abilities.effects.EffectPackageInitialiser;
import graphics.graphical_abstraction.GraphicsMasterAbstraction;
// Log system
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;
/**
* Created by dupriez on 10/11/15.
*
......@@ -12,7 +16,16 @@ import graphics.graphical_abstraction.GraphicsMasterAbstraction;
*/
public class Igniter_Main {
static Logger logger = Logger.getLogger(Igniter_Main.class);
public static void main(String[] args) {
logger.debug("msg de debogage");
logger.info("msg d'information");
logger.warn("msg d'avertissement");
logger.error("msg d'erreur");
logger.fatal("msg d'erreur fatale");
/** Initialise some packages to detect instantly uncorrect declarations **/
AbilityPackageInitialiser.initialisePackage();
EffectPackageInitialiser.initialisePackage();
......
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%%-5p (%F:%M:%L) %m%n
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment