Skip to content

Commit d79df33

Browse files
committed
Updated Bootstrap.java to use new logging system...
1 parent e33309f commit d79df33

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/main/java/org/mangorage/bootstrap/Bootstrap.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.mangorage.bootstrap;
22

33
import org.mangorage.bootstrap.api.launch.ILaunchTarget;
4+
import org.mangorage.bootstrap.api.logging.ILoggerFactory;
5+
import org.mangorage.bootstrap.api.logging.IMangoLogger;
46
import org.mangorage.bootstrap.internal.logger.DefaultLoggerFactory;
57
import org.mangorage.bootstrap.internal.util.Util;
68

@@ -13,8 +15,6 @@
1315
import java.util.Map;
1416
import java.util.ServiceLoader;
1517
import java.util.Set;
16-
import java.util.logging.Logger;
17-
import java.util.logging.Level;
1818

1919
/**
2020
* Bootstrap orchestrator for modular applications.
@@ -34,7 +34,7 @@
3434
*/
3535
public final class Bootstrap {
3636

37-
private static final Logger LOGGER = Logger.getLogger(Bootstrap.class.getName());
37+
private static final IMangoLogger LOGGER = ILoggerFactory.getDefault().getProvider("slf4j").getLogger(Bootstrap.class);
3838
private static final String LAUNCH_TARGET_ARG = "--launchTarget";
3939
private static final String DEFAULT_LAUNCH_PATH = "launch";
4040

@@ -85,7 +85,7 @@ public static void main(String[] args) throws Throwable {
8585
DefaultLoggerFactory.load(launchLayer); // Load the providers this layer has!
8686
}
8787
} catch (Throwable t) {
88-
LOGGER.log(Level.SEVERE, "Error during launch target execution: " + launchTarget, t);
88+
LOGGER.error("Error during launch target execution: " + launchTarget, t);
8989
lifecycleHooks.forEach(hook -> hook.onError(t, moduleLayer));
9090
throw t;
9191
}
@@ -153,11 +153,11 @@ private static ModuleLayer createLaunchModuleLayer(ModuleLayer parent, Path laun
153153
Thread.currentThread().getContextClassLoader()
154154
);
155155

156-
LOGGER.fine("Successfully created module layer with " + moduleCfg.modules().size() + " modules");
156+
LOGGER.info("Successfully created module layer with " + moduleCfg.modules().size() + " modules");
157157
return moduleLayerController.layer();
158158

159159
} catch (Exception e) {
160-
LOGGER.log(Level.SEVERE, "Failed to create module layer from path: " + launchPath, e);
160+
LOGGER.error("Failed to create module layer from path: " + launchPath, e);
161161
throw new IllegalStateException("Module layer creation failed", e);
162162
}
163163
}
@@ -177,25 +177,25 @@ private static Map<String, ILaunchTarget> discoverLaunchTargets(ModuleLayer modu
177177
final String targetId = target.getId();
178178

179179
if (targetId == null || targetId.trim().isEmpty()) {
180-
LOGGER.warning("Ignoring launch target with null or empty ID from provider: " + provider.type());
180+
LOGGER.info("Ignoring launch target with null or empty ID from provider: " + provider.type());
181181
return;
182182
}
183183

184184
if (launchTargetMap.containsKey(targetId)) {
185-
LOGGER.warning("Duplicate launch target ID detected: " + targetId + ". Using first occurrence.");
185+
LOGGER.info("Duplicate launch target ID detected: " + targetId + ". Using first occurrence.");
186186
return;
187187
}
188188

189189
launchTargetMap.put(targetId, target);
190-
LOGGER.fine("Discovered launch target: " + targetId + " (" + provider.type() + ")");
190+
LOGGER.info("Discovered launch target: " + targetId + " (" + provider.type() + ")");
191191

192192
} catch (Exception e) {
193-
LOGGER.log(Level.WARNING, "Failed to load launch target provider: " + provider.type(), e);
193+
LOGGER.warn("Failed to load launch target provider: " + provider.type(), e);
194194
}
195195
});
196196

197197
} catch (Exception e) {
198-
LOGGER.log(Level.SEVERE, "Failed to discover launch targets", e);
198+
LOGGER.error("Failed to discover launch targets", e);
199199
throw new IllegalStateException("Launch target discovery failed", e);
200200
}
201201

0 commit comments

Comments
 (0)