Skip to content

Commit 6f33208

Browse files
committed
Merge branch 'master' into ban-xiu/master
2 parents d5574ce + 8c413e2 commit 6f33208

File tree

11 files changed

+50
-23
lines changed

11 files changed

+50
-23
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM openjdk:8-jdk-alpine
22

3-
ARG ARTHAS_VERSION="4.1.4"
3+
ARG ARTHAS_VERSION="4.1.5"
44
ARG MIRROR=false
55

66
ENV MAVEN_HOST=https://repo1.maven.org/maven2 \

Dockerfile-No-Jdk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stage 1: Build
22
FROM openjdk:8-jdk-alpine AS builder
33

4-
ARG ARTHAS_VERSION="4.1.4"
4+
ARG ARTHAS_VERSION="4.1.5"
55
ARG MIRROR=false
66
ENV MAVEN_HOST=https://repo1.maven.org/maven2 \
77
MIRROR_MAVEN_HOST=https://maven.aliyun.com/repository/public

bin/as.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
# program : Arthas
1010
# author : Core Engine @ Taobao.com
11-
# date : 2025-12-29
11+
# date : 2026-01-10
1212

1313
# current arthas script version
14-
ARTHAS_SCRIPT_VERSION=4.1.4
14+
ARTHAS_SCRIPT_VERSION=4.1.5
1515

1616
# SYNOPSIS
1717
# rreadlink <fileOrDirPath>
@@ -476,7 +476,7 @@ EXAMPLES:
476476
./as.sh --stat-url 'http://192.168.10.11:8080/api/stat'
477477
./as.sh -c 'sysprop; thread' <pid>
478478
./as.sh -f batch.as <pid>
479-
./as.sh --use-version 4.1.4
479+
./as.sh --use-version 4.1.5
480480
./as.sh --session-timeout 3600
481481
./as.sh --attach-only
482482
./as.sh --disabled-commands stop,dump

boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
+ " java -jar arthas-boot.jar --stat-url 'http://192.168.10.11:8080/api/stat'\n"
5555
+ " java -jar arthas-boot.jar -c 'sysprop; thread' <pid>\n"
5656
+ " java -jar arthas-boot.jar -f batch.as <pid>\n"
57-
+ " java -jar arthas-boot.jar --use-version 4.1.4\n"
57+
+ " java -jar arthas-boot.jar --use-version 4.1.5\n"
5858
+ " java -jar arthas-boot.jar --versions\n"
5959
+ " java -jar arthas-boot.jar --select math-game\n"
6060
+ " java -jar arthas-boot.jar --session-timeout 3600\n" + " java -jar arthas-boot.jar --attach-only\n"

common/src/main/java/com/taobao/arthas/common/AnsiLog.java

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.taobao.arthas.common;
22

3+
import java.io.PrintStream;
34
import java.util.logging.Level;
45
import java.util.regex.Matcher;
56

@@ -23,6 +24,11 @@ public abstract class AnsiLog {
2324

2425
static boolean enableColor;
2526

27+
/**
28+
* Output stream for log messages, defaults to System.out.
29+
*/
30+
private static volatile PrintStream out = System.out;
31+
2632
public static java.util.logging.Level LEVEL = java.util.logging.Level.CONFIG;
2733

2834
private static final String RESET = "\033[0m";
@@ -77,6 +83,27 @@ public static boolean enableColor() {
7783
return enableColor;
7884
}
7985

86+
/**
87+
* 设置日志输出流
88+
*
89+
* @param printStream 输出流,传入 null 时使用 System.out
90+
* @return 之前的输出流
91+
*/
92+
public static PrintStream out(PrintStream printStream) {
93+
PrintStream old = out;
94+
out = printStream == null ? System.out : printStream;
95+
return old;
96+
}
97+
98+
/**
99+
* 获取当前日志输出流
100+
*
101+
* @return 当前输出流
102+
*/
103+
public static PrintStream out() {
104+
return out;
105+
}
106+
80107
/**
81108
* set logger Level
82109
*
@@ -170,9 +197,9 @@ private static String colorStr(String msg, int colorCode) {
170197
public static void trace(String msg) {
171198
if (canLog(Level.FINEST)) {
172199
if (enableColor) {
173-
System.out.println(TRACE_COLOR_PREFIX + msg);
200+
out.println(TRACE_COLOR_PREFIX + msg);
174201
} else {
175-
System.out.println(TRACE_PREFIX + msg);
202+
out.println(TRACE_PREFIX + msg);
176203
}
177204
}
178205
}
@@ -185,16 +212,16 @@ public static void trace(String format, Object... arguments) {
185212

186213
public static void trace(Throwable t) {
187214
if (canLog(Level.FINEST)) {
188-
t.printStackTrace(System.out);
215+
t.printStackTrace(out);
189216
}
190217
}
191218

192219
public static void debug(String msg) {
193220
if (canLog(Level.FINER)) {
194221
if (enableColor) {
195-
System.out.println(DEBUG_COLOR_PREFIX + msg);
222+
out.println(DEBUG_COLOR_PREFIX + msg);
196223
} else {
197-
System.out.println(DEBUG_PREFIX + msg);
224+
out.println(DEBUG_PREFIX + msg);
198225
}
199226
}
200227
}
@@ -207,16 +234,16 @@ public static void debug(String format, Object... arguments) {
207234

208235
public static void debug(Throwable t) {
209236
if (canLog(Level.FINER)) {
210-
t.printStackTrace(System.out);
237+
t.printStackTrace(out);
211238
}
212239
}
213240

214241
public static void info(String msg) {
215242
if (canLog(Level.CONFIG)) {
216243
if (enableColor) {
217-
System.out.println(INFO_COLOR_PREFIX + msg);
244+
out.println(INFO_COLOR_PREFIX + msg);
218245
} else {
219-
System.out.println(INFO_PREFIX + msg);
246+
out.println(INFO_PREFIX + msg);
220247
}
221248
}
222249
}
@@ -229,16 +256,16 @@ public static void info(String format, Object... arguments) {
229256

230257
public static void info(Throwable t) {
231258
if (canLog(Level.CONFIG)) {
232-
t.printStackTrace(System.out);
259+
t.printStackTrace(out);
233260
}
234261
}
235262

236263
public static void warn(String msg) {
237264
if (canLog(Level.WARNING)) {
238265
if (enableColor) {
239-
System.out.println(WARN_COLOR_PREFIX + msg);
266+
out.println(WARN_COLOR_PREFIX + msg);
240267
} else {
241-
System.out.println(WARN_PREFIX + msg);
268+
out.println(WARN_PREFIX + msg);
242269
}
243270
}
244271
}
@@ -251,16 +278,16 @@ public static void warn(String format, Object... arguments) {
251278

252279
public static void warn(Throwable t) {
253280
if (canLog(Level.WARNING)) {
254-
t.printStackTrace(System.out);
281+
t.printStackTrace(out);
255282
}
256283
}
257284

258285
public static void error(String msg) {
259286
if (canLog(Level.SEVERE)) {
260287
if (enableColor) {
261-
System.out.println(ERROR_COLOR_PREFIX + msg);
288+
out.println(ERROR_COLOR_PREFIX + msg);
262289
} else {
263-
System.out.println(ERROR_PREFIX + msg);
290+
out.println(ERROR_PREFIX + msg);
264291
}
265292
}
266293
}
@@ -273,7 +300,7 @@ public static void error(String format, Object... arguments) {
273300

274301
public static void error(Throwable t) {
275302
if (canLog(Level.SEVERE)) {
276-
t.printStackTrace(System.out);
303+
t.printStackTrace(out);
277304
}
278305
}
279306

core/src/main/java/com/taobao/arthas/core/mcp/ArthasMcpServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void start() {
8484

8585
McpServerProperties properties = new McpServerProperties.Builder()
8686
.name("arthas-mcp-server")
87-
.version("4.1.4")
87+
.version("4.1.5")
8888
.mcpEndpoint(mcpEndpoint)
8989
.toolChangeNotification(true)
9090
.resourceChangeNotification(true)

lib/libArthasJniLibrary-aarch64.so

19 KB
Binary file not shown.

lib/libArthasJniLibrary-x64.dll

-2.22 MB
Binary file not shown.

lib/libArthasJniLibrary-x64.so

26.6 KB
Binary file not shown.

lib/libArthasJniLibrary.dylib

2.89 KB
Binary file not shown.

0 commit comments

Comments
 (0)