rename logFile to logPath

This commit is contained in:
aliamerj
2025-11-04 10:09:34 +03:00
parent 976787dbf1
commit 49d36b7e7e
5 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -378,7 +378,7 @@ func generateDebugBundle(config *profilemanager.Config, recorder *peer.Status, c
InternalConfig: config, InternalConfig: config,
StatusRecorder: recorder, StatusRecorder: recorder,
SyncResponse: syncResponse, SyncResponse: syncResponse,
LogFile: logFilePath, LogPath: logFilePath,
}, },
debug.BundleConfig{ debug.BundleConfig{
IncludeSystemInfo: true, IncludeSystemInfo: true,
+6 -6
View File
@@ -62,8 +62,8 @@ func NewConnectClient(
} }
// Run with main logic. // Run with main logic.
func (c *ConnectClient) Run(runningChan chan struct{}, logFile string) error { func (c *ConnectClient) Run(runningChan chan struct{}, logPath string) error {
return c.run(MobileDependency{}, runningChan, logFile) return c.run(MobileDependency{}, runningChan, logPath)
} }
// RunOnAndroid with main logic on mobile system // RunOnAndroid with main logic on mobile system
@@ -103,7 +103,7 @@ func (c *ConnectClient) RunOniOS(
return c.run(mobileDependency, nil, "") return c.run(mobileDependency, nil, "")
} }
func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan struct{}, logFile string) error { func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan struct{}, logPath string) error {
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
rec := c.statusRecorder rec := c.statusRecorder
@@ -246,7 +246,7 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan
relayURLs, token := parseRelayInfo(loginResp) relayURLs, token := parseRelayInfo(loginResp)
peerConfig := loginResp.GetPeerConfig() peerConfig := loginResp.GetPeerConfig()
engineConfig, err := createEngineConfig(myPrivateKey, c.config, peerConfig, logFile) engineConfig, err := createEngineConfig(myPrivateKey, c.config, peerConfig, logPath)
if err != nil { if err != nil {
log.Error(err) log.Error(err)
return wrapErr(err) return wrapErr(err)
@@ -413,7 +413,7 @@ func (c *ConnectClient) SetSyncResponsePersistence(enabled bool) {
} }
// createEngineConfig converts configuration received from Management Service to EngineConfig // createEngineConfig converts configuration received from Management Service to EngineConfig
func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConfig *mgmProto.PeerConfig, logFile string) (*EngineConfig, error) { func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConfig *mgmProto.PeerConfig, logPath string) (*EngineConfig, error) {
nm := false nm := false
if config.NetworkMonitor != nil { if config.NetworkMonitor != nil {
nm = *config.NetworkMonitor nm = *config.NetworkMonitor
@@ -444,7 +444,7 @@ func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConf
LazyConnectionEnabled: config.LazyConnectionEnabled, LazyConnectionEnabled: config.LazyConnectionEnabled,
MTU: selectMTU(config.MTU, peerConfig.Mtu), MTU: selectMTU(config.MTU, peerConfig.Mtu),
LogFile: logFile, LogPath: logPath,
ProfileConfig: config, ProfileConfig: config,
} }
+7 -7
View File
@@ -202,7 +202,7 @@ type BundleGenerator struct {
internalConfig *profilemanager.Config internalConfig *profilemanager.Config
statusRecorder *peer.Status statusRecorder *peer.Status
syncResponse *mgmProto.SyncResponse syncResponse *mgmProto.SyncResponse
logFile string logPath string
anonymize bool anonymize bool
clientStatus string clientStatus string
@@ -223,7 +223,7 @@ type GeneratorDependencies struct {
InternalConfig *profilemanager.Config InternalConfig *profilemanager.Config
StatusRecorder *peer.Status StatusRecorder *peer.Status
SyncResponse *mgmProto.SyncResponse SyncResponse *mgmProto.SyncResponse
LogFile string LogPath string
} }
func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGenerator { func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGenerator {
@@ -239,7 +239,7 @@ func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGen
internalConfig: deps.InternalConfig, internalConfig: deps.InternalConfig,
statusRecorder: deps.StatusRecorder, statusRecorder: deps.StatusRecorder,
syncResponse: deps.SyncResponse, syncResponse: deps.SyncResponse,
logFile: deps.LogFile, logPath: deps.LogPath,
anonymize: cfg.Anonymize, anonymize: cfg.Anonymize,
clientStatus: cfg.ClientStatus, clientStatus: cfg.ClientStatus,
@@ -327,7 +327,7 @@ func (g *BundleGenerator) createArchive() error {
log.Errorf("failed to add wg show output: %v", err) log.Errorf("failed to add wg show output: %v", err)
} }
if g.logFile != "" && !slices.Contains(util.SpecialLogs, g.logFile) { if g.logPath != "" && !slices.Contains(util.SpecialLogs, g.logPath) {
if err := g.addLogfile(); err != nil { if err := g.addLogfile(); err != nil {
log.Errorf("failed to add log file to debug bundle: %v", err) log.Errorf("failed to add log file to debug bundle: %v", err)
if err := g.trySystemdLogFallback(); err != nil { if err := g.trySystemdLogFallback(); err != nil {
@@ -630,14 +630,14 @@ func (g *BundleGenerator) addCorruptedStateFiles() error {
} }
func (g *BundleGenerator) addLogfile() error { func (g *BundleGenerator) addLogfile() error {
if g.logFile == "" { if g.logPath == "" {
log.Debugf("skipping empty log file in debug bundle") log.Debugf("skipping empty log file in debug bundle")
return nil return nil
} }
logDir := filepath.Dir(g.logFile) logDir := filepath.Dir(g.logPath)
if err := g.addSingleLogfile(g.logFile, clientLogFile); err != nil { if err := g.addSingleLogfile(g.logPath, clientLogFile); err != nil {
return fmt.Errorf("add client log file to zip: %w", err) return fmt.Errorf("add client log file to zip: %w", err)
} }
+2 -2
View File
@@ -137,7 +137,7 @@ type EngineConfig struct {
// for debug bundle generation // for debug bundle generation
ProfileConfig *profilemanager.Config ProfileConfig *profilemanager.Config
LogFile string LogPath string
} }
// Engine is a mechanism responsible for reacting on Signal and Management stream events and managing connections to the remote peers. // 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
InternalConfig: e.config.ProfileConfig, InternalConfig: e.config.ProfileConfig,
StatusRecorder: e.statusRecorder, StatusRecorder: e.statusRecorder,
SyncResponse: syncResponse, SyncResponse: syncResponse,
LogFile: e.config.LogFile, LogPath: e.config.LogPath,
} }
bundleJobParams := debug.BundleConfig{ bundleJobParams := debug.BundleConfig{
+1 -1
View File
@@ -29,7 +29,7 @@ func (s *Server) DebugBundle(_ context.Context, req *proto.DebugBundleRequest) (
InternalConfig: s.config, InternalConfig: s.config,
StatusRecorder: s.statusRecorder, StatusRecorder: s.statusRecorder,
SyncResponse: syncResponse, SyncResponse: syncResponse,
LogFile: s.logFile, LogPath: s.logFile,
}, },
debug.BundleConfig{ debug.BundleConfig{
Anonymize: req.GetAnonymize(), Anonymize: req.GetAnonymize(),