Skip to content

Commit 986122d

Browse files
committed
consumer: keep fixed default log file name
1 parent 24f4ee7 commit 986122d

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

‎cmd/consumer/main.go‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
_ "net/http/pprof" //nolint:gosec // pprof is served on 127.0.0.1 only and gated by --enable-profiling.
2121
"os"
2222
"os/signal"
23-
"path/filepath"
2423
"syscall"
2524
"time"
2625

@@ -101,7 +100,7 @@ func newCommand() *cobra.Command {
101100
flags.StringVar(&options.configFile, "config", "", "consumer configuration file")
102101
flags.StringVar(&options.consumerID, "consumer-id", "",
103102
"Kafka group ID or Pulsar subscription name (random if omitted)")
104-
flags.StringVar(&options.logFile, "log-file", defaultLogFileName(), "log file path")
103+
flags.StringVar(&options.logFile, "log-file", "cdc_consumer.log", "log file path")
105104
flags.BoolVar(&options.enableProfiling, "enable-profiling", false, "enable pprof on "+profileAddress)
106105

107106
// Legacy CLI flags kept hidden so copied legacy consumer names work on older branches.
@@ -138,11 +137,3 @@ func newCommand() *cobra.Command {
138137

139138
return command
140139
}
141-
142-
func defaultLogFileName() string {
143-
base := filepath.Base(os.Args[0])
144-
if base == "" || base == "." || base == string(filepath.Separator) {
145-
return "cdc_consumer.log"
146-
}
147-
return base + ".log"
148-
}

0 commit comments

Comments
 (0)