■ ■ ■ ■ ■ ■
src/main/java/io/onedev/k8shelper/KubernetesHelper.java
1 | 1 | | package io.onedev.k8shelper; |
2 | 2 | | |
| 3 | + | import static java.nio.charset.StandardCharsets.UTF_8; |
| 4 | + | |
3 | 5 | | import java.io.File; |
4 | 6 | | import java.io.FileFilter; |
5 | 7 | | import java.io.IOException; |
| skipped 1 lines |
7 | 9 | | import java.io.OutputStream; |
8 | 10 | | import java.nio.ByteBuffer; |
9 | 11 | | import java.nio.charset.Charset; |
10 | | - | import static java.nio.charset.StandardCharsets.UTF_8; |
11 | 12 | | import java.nio.file.Files; |
12 | 13 | | import java.util.ArrayList; |
13 | 14 | | import java.util.Base64; |
| skipped 264 lines |
278 | 279 | | @Override |
279 | 280 | | public void consume(String line) { |
280 | 281 | | if (!line.contains("Warning: use -cacerts option to access cacerts keystore")) |
281 | | - | logger.error(line); |
| 282 | + | logger.error(wrapWithAnsiBoldRed(line)); |
282 | 283 | | } |
283 | 284 | | |
284 | 285 | | }).checkReturnCode(); |
| skipped 18 lines |
303 | 304 | | |
304 | 305 | | @Override |
305 | 306 | | public void consume(String line) { |
306 | | - | logger.error(line); |
| 307 | + | logger.error(wrapWithAnsiBoldRed(line)); |
307 | 308 | | } |
308 | 309 | | |
309 | 310 | | }; |
| skipped 642 lines |
952 | 953 | | for (String each: collection) |
953 | 954 | | replacedCollection.add(replacePlaceholders(each, buildHome)); |
954 | 955 | | return replacedCollection; |
| 956 | + | } |
| 957 | + | |
| 958 | + | public static String wrapWithAnsiBoldRed(String text) { |
| 959 | + | return "\033[1;31m" + text + "\033[0m"; |
| 960 | + | } |
| 961 | + | |
| 962 | + | public static String wrapWithAnsiBoldYellow(String text) { |
| 963 | + | return "\033[1;33m" + text + "\033[0m"; |
| 964 | + | } |
| 965 | + | |
| 966 | + | public static String wrapWithAnsiBold(String text) { |
| 967 | + | return "\033[1;35m" + text + "\033[0m"; |
955 | 968 | | } |
956 | 969 | | |
957 | 970 | | } |
| skipped 1 lines |