Croway commented on code in PR #16851:
URL: https://github.com/apache/camel/pull/16851#discussion_r1922403934


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java:
##########
@@ -150,14 +137,43 @@ private void run(String testService, String 
testServiceImplementation) throws Ex
 
         printer().println(jsonMapper.writeValueAsString(properties));
 
+        String name = getLogFileName(testService, RuntimeUtil.getPid());
+        File logFile = new File(CommandLineHelper.getCamelDir(), name);
+        logFile.createNewFile();
+        logFile.deleteOnExit();
+
+        if (actualService instanceof ContainerService<?> cs) {
+            cs.followLog(new CamelLogConsumer(logFile.toPath(), logToStdout));
+        }
+
         if (!jsonOutput) {
-            printer().println("To stop the execution press q");
+            printer().println("Press any key to stop the execution");
         }
-        Scanner sc = new Scanner(System.in).useDelimiter("\n");
+        Scanner sc = new Scanner(System.in);
 
-        if (sc.nextLine().equals("q")) {
-            
actualService.getClass().getMethod("shutdown").invoke(actualService);
-            sc.close();
+        while (!sc.hasNext()) {
         }
+
+        ((InfrastructureService) actualService).shutdown();
+        sc.close();
+    }
+
+    private static @NotNull DependencyDownloaderClassLoader 
getDependencyDownloaderClassLoader(

Review Comment:
   thanks, I removed that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to