e7f7f98a522a13dffbcacb8cbe59ffd709f650c8
[deliverable/lttng-ivc.git] / lttng_ivc / apps / jul-1.0 / App.java
1 import java.io.IOException;
2 import java.io.File;
3 import java.util.logging.Logger;
4 import java.util.logging.Level;
5 import java.util.logging.ConsoleHandler;
6 import org.lttng.ust.agent.LTTngAgent;
7
8 public class App
9 {
10 private static final int answer = 42;
11
12 public static void main(String[] argv) throws Exception
13 {
14 int nrIter = Integer.parseInt(argv[0]);
15 String sync_first_tp_hit_path = null;
16 String sync_wait_before_last = null;
17
18 if (argv.length > 1) {
19 sync_first_tp_hit_path = argv[1];
20 }
21 if (argv.length > 2) {
22 sync_wait_before_last = argv[2];
23 }
24
25 // Create a logger
26 Logger logger = Logger.getLogger("jello");
27 logger.setLevel(Level.INFO);
28
29 LTTngAgent lttngAgent = LTTngAgent.getLTTngAgent();
30
31 for (int i=0; i < 0 || i < nrIter; i++) {
32 if ( i >= 0 && i == nrIter -1 && sync_wait_before_last != null) {
33 File f = new File(sync_wait_before_last);
34 while (!f.exists()) {
35 Thread.sleep(1);
36 }
37 }
38 logger.info("logging the world");
39 logger.warning("some warning");
40 logger.severe("error!");
41 if (i == 0 && sync_first_tp_hit_path != null) {
42 File f = new File(sync_first_tp_hit_path);
43 f.createNewFile();
44 }
45 }
46
47 // Not mandatory, but cleaner
48 lttngAgent.dispose();
49 }
50 }
This page took 0.031615 seconds and 4 git commands to generate.