Closed fatiiates closed 2 years ago
I didn't get the logs. It is probably generally preferable to be directed rather than taken.
So, you have defined an interface named LogReader. I also created the following class that I implemented from LogReader class.
public static class BuildpacksLogger implements LogReader {
private PrintStream ps;
BuildpacksLogger(){}
BuildpacksLogger(PrintStream ps){
this.ps = ps;
}
@Override
public boolean stripAnsiColor() {
return true;
}
@Override
public void stdout(String message) {
if (message.endsWith("\n")) {
message = message.substring(0, message.length() - 1);
}
ps.println(message);
}
@Override
public void stderr(String message) {
if (message.endsWith("\n")) {
message = message.substring(0, message.length() - 1);
}
ps.println(message);
}
}
I cannot export the logs in the BuildpackBuilderImpl class at the moment. However, it was enough to get the current lifecycle logs. Thanks.
Hi,
I need to show the outputs to users on a different platform instead of the console, so I want to access the logs written to the console. Can you help me ?