-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mullon <ch.mullon@gmail.com>
- Loading branch information
Showing
59 changed files
with
603 additions
and
910 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package fr.cm.Main; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.FileHandler; | ||
import java.util.logging.Logger; | ||
import java.util.logging.SimpleFormatter; | ||
|
||
public class Logg { | ||
static Logger logger = Logger.getLogger("MyLog"); | ||
static void createLog(){ | ||
FileHandler fileHandler; | ||
try { | ||
// This block configure the logger with handler and formatter | ||
fileHandler = new FileHandler("rCaNlog.txt"); | ||
logger.addHandler(fileHandler); | ||
SimpleFormatter formatter = new SimpleFormatter(); | ||
fileHandler.setFormatter(formatter); | ||
} catch (SecurityException e) { | ||
e.printStackTrace(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
public static void addLog(String msg){ | ||
try { | ||
logger.info(msg); | ||
} catch (SecurityException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.