Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
HI, I am executing a java class from terminal in windchill environment. If I use System.out.println("Print this "); method , output gets printed in methodserver log file. I want this output to be printed on Terminal from which I executed my java file. How any I achieve this?
Solved! Go to Solution.
public static void printMessageToConsole(String message) {
MethodContext methodContext = MethodContext.getContext();
methodContext.sendFeedback(new StatusFeedback(message));
}
public static void printMessageToConsole(String message) {
MethodContext methodContext = MethodContext.getContext();
methodContext.sendFeedback(new StatusFeedback(message));
}
Hi @BjoernRueegg , Your solution is working … Thank you , I have a same requirement with a twist.
I am doing some processing I want to print processing % on console,
e.g. Processing completed ---> 1%
Processing completed ---> 2%
.
Instead of printing this on next line, how can I overwrite it on previous ?
Sorry, that is beyond my knowledge.
okay,, Thank you for your support.
I would avoid printing on the same line if I can, unless this is important and logging is not. If it must be done, one method would be to use print rather than println, and use \r to clear the previous value