File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
kotlin/com/tencent/bk/devops/plugin/script Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
142142 private static boolean SHOW_THREAD_NAME = false ;
143143 private static boolean SHOW_LOG_NAME = false ;
144144 private static boolean SHOW_SHORT_LOG_NAME = false ;
145- private static String LOG_FILE = "System.err " ;
145+ private static String LOG_FILE = "System.out " ;
146146 private static PrintStream TARGET_STREAM = null ;
147147 private static boolean LEVEL_IN_BRACKETS = false ;
148148 private static String WARN_LEVEL_STRING = "WARN" ;
Original file line number Diff line number Diff line change @@ -33,7 +33,21 @@ object CommandLineUtils {
3333 result.append(tmpLine).append(" \n " )
3434 }
3535 }
36- executor.streamHandler = PumpStreamHandler (outputStream)
36+
37+ val errorStream = object : LogOutputStream () {
38+ override fun processLine (line : String? , level : Int ) {
39+ if (line == null ) {
40+ return
41+ }
42+
43+ val tmpLine = SensitiveLineParser .onParseLine(prefix + line)
44+ if (print2Logger) {
45+ logger.error(tmpLine)
46+ }
47+ result.append(tmpLine).append(" \n " )
48+ }
49+ }
50+ executor.streamHandler = PumpStreamHandler (outputStream, errorStream)
3751
3852 try {
3953 val exitCode = executor.execute(cmdLine)
You can’t perform that action at this time.
0 commit comments