Skip to content

Commit 49d36b7

Browse files
committed
rename logFile to logPath
1 parent 976787d commit 49d36b7

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

client/cmd/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ func generateDebugBundle(config *profilemanager.Config, recorder *peer.Status, c
378378
InternalConfig: config,
379379
StatusRecorder: recorder,
380380
SyncResponse: syncResponse,
381-
LogFile: logFilePath,
381+
LogPath: logFilePath,
382382
},
383383
debug.BundleConfig{
384384
IncludeSystemInfo: true,

client/internal/connect.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func NewConnectClient(
6262
}
6363

6464
// Run with main logic.
65-
func (c *ConnectClient) Run(runningChan chan struct{}, logFile string) error {
66-
return c.run(MobileDependency{}, runningChan, logFile)
65+
func (c *ConnectClient) Run(runningChan chan struct{}, logPath string) error {
66+
return c.run(MobileDependency{}, runningChan, logPath)
6767
}
6868

6969
// RunOnAndroid with main logic on mobile system
@@ -103,7 +103,7 @@ func (c *ConnectClient) RunOniOS(
103103
return c.run(mobileDependency, nil, "")
104104
}
105105

106-
func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan struct{}, logFile string) error {
106+
func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan struct{}, logPath string) error {
107107
defer func() {
108108
if r := recover(); r != nil {
109109
rec := c.statusRecorder
@@ -246,7 +246,7 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan
246246
relayURLs, token := parseRelayInfo(loginResp)
247247
peerConfig := loginResp.GetPeerConfig()
248248

249-
engineConfig, err := createEngineConfig(myPrivateKey, c.config, peerConfig, logFile)
249+
engineConfig, err := createEngineConfig(myPrivateKey, c.config, peerConfig, logPath)
250250
if err != nil {
251251
log.Error(err)
252252
return wrapErr(err)
@@ -413,7 +413,7 @@ func (c *ConnectClient) SetSyncResponsePersistence(enabled bool) {
413413
}
414414

415415
// createEngineConfig converts configuration received from Management Service to EngineConfig
416-
func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConfig *mgmProto.PeerConfig, logFile string) (*EngineConfig, error) {
416+
func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConfig *mgmProto.PeerConfig, logPath string) (*EngineConfig, error) {
417417
nm := false
418418
if config.NetworkMonitor != nil {
419419
nm = *config.NetworkMonitor
@@ -444,7 +444,7 @@ func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConf
444444
LazyConnectionEnabled: config.LazyConnectionEnabled,
445445

446446
MTU: selectMTU(config.MTU, peerConfig.Mtu),
447-
LogFile: logFile,
447+
LogPath: logPath,
448448

449449
ProfileConfig: config,
450450
}

client/internal/debug/debug.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ type BundleGenerator struct {
202202
internalConfig *profilemanager.Config
203203
statusRecorder *peer.Status
204204
syncResponse *mgmProto.SyncResponse
205-
logFile string
205+
logPath string
206206

207207
anonymize bool
208208
clientStatus string
@@ -223,7 +223,7 @@ type GeneratorDependencies struct {
223223
InternalConfig *profilemanager.Config
224224
StatusRecorder *peer.Status
225225
SyncResponse *mgmProto.SyncResponse
226-
LogFile string
226+
LogPath string
227227
}
228228

229229
func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGenerator {
@@ -239,7 +239,7 @@ func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGen
239239
internalConfig: deps.InternalConfig,
240240
statusRecorder: deps.StatusRecorder,
241241
syncResponse: deps.SyncResponse,
242-
logFile: deps.LogFile,
242+
logPath: deps.LogPath,
243243

244244
anonymize: cfg.Anonymize,
245245
clientStatus: cfg.ClientStatus,
@@ -327,7 +327,7 @@ func (g *BundleGenerator) createArchive() error {
327327
log.Errorf("failed to add wg show output: %v", err)
328328
}
329329

330-
if g.logFile != "" && !slices.Contains(util.SpecialLogs, g.logFile) {
330+
if g.logPath != "" && !slices.Contains(util.SpecialLogs, g.logPath) {
331331
if err := g.addLogfile(); err != nil {
332332
log.Errorf("failed to add log file to debug bundle: %v", err)
333333
if err := g.trySystemdLogFallback(); err != nil {
@@ -630,14 +630,14 @@ func (g *BundleGenerator) addCorruptedStateFiles() error {
630630
}
631631

632632
func (g *BundleGenerator) addLogfile() error {
633-
if g.logFile == "" {
633+
if g.logPath == "" {
634634
log.Debugf("skipping empty log file in debug bundle")
635635
return nil
636636
}
637637

638-
logDir := filepath.Dir(g.logFile)
638+
logDir := filepath.Dir(g.logPath)
639639

640-
if err := g.addSingleLogfile(g.logFile, clientLogFile); err != nil {
640+
if err := g.addSingleLogfile(g.logPath, clientLogFile); err != nil {
641641
return fmt.Errorf("add client log file to zip: %w", err)
642642
}
643643

client/internal/engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ type EngineConfig struct {
137137
// for debug bundle generation
138138
ProfileConfig *profilemanager.Config
139139

140-
LogFile string
140+
LogPath string
141141
}
142142

143143
// Engine is a mechanism responsible for reacting on Signal and Management stream events and managing connections to the remote peers.
@@ -1016,7 +1016,7 @@ func (e *Engine) handleBundle(params *mgmProto.BundleParameters) (*mgmProto.JobR
10161016
InternalConfig: e.config.ProfileConfig,
10171017
StatusRecorder: e.statusRecorder,
10181018
SyncResponse: syncResponse,
1019-
LogFile: e.config.LogFile,
1019+
LogPath: e.config.LogPath,
10201020
}
10211021

10221022
bundleJobParams := debug.BundleConfig{

client/server/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (s *Server) DebugBundle(_ context.Context, req *proto.DebugBundleRequest) (
2929
InternalConfig: s.config,
3030
StatusRecorder: s.statusRecorder,
3131
SyncResponse: syncResponse,
32-
LogFile: s.logFile,
32+
LogPath: s.logFile,
3333
},
3434
debug.BundleConfig{
3535
Anonymize: req.GetAnonymize(),

0 commit comments

Comments
 (0)