Skip to content

Commit 06b440d

Browse files
committed
Move logCLIArguments after jattach capture mode to avoid log output for jattach capture mode
1 parent a48188a commit 06b440d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/cli/cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ func Run() {
2727
initConfig()
2828
initLogger()
2929

30-
logCLIArguments()
30+
runJattachCaptureModesIfConditionSatisfied()
3131

32-
runJattachCaptureModes()
32+
logCLIArguments()
3333

3434
if config.GlobalConfig.ShowVersion {
3535
logger.Log("yc-360 script version: " + executils.SCRIPT_VERSION)

internal/cli/custom_mode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ func runRawCaptureModeIfConditionSatisfied() {
2626
}
2727
}
2828

29-
// runJattachCaptureModes runs jattach-based capture modes depending on the config.
29+
// runJattachCaptureModesIfConditionSatisfied runs jattach-based capture modes depending on the config.
3030
// These modes (GC, thread dump, heap dump, jcmd) use jattach for direct Java diagnostics.
3131
// This function can be run after parsing the config flags and exits immediately upon execution.
32-
func runJattachCaptureModes() {
32+
func runJattachCaptureModesIfConditionSatisfied() {
3333
if config.GlobalConfig.GCCaptureMode {
3434
pid, err := strconv.Atoi(config.GlobalConfig.Pid)
3535
if err != nil {

0 commit comments

Comments
 (0)