Skip to content

Commit

Permalink
In Client Library, use log file facility when EmitDiagnosticNotices i…
Browse files Browse the repository at this point in the history
…s set
  • Loading branch information
rod-hynes committed Aug 6, 2019
1 parent a1485be commit 4c2cbfe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ClientLibrary/clientlib/clientlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ func StartTunnel(ctx context.Context,
}
}

// As Client Library doesn't currently implement callbacks, diagnostic
// notices aren't relayed to the client application. So, when
// EmitDiagnosticNotices is set, initialize the rotating diagnostic log file
// facility.
if config.EmitDiagnosticNotices {
err := psiphon.SetNoticeFiles("", filepath.Join(config.DataStoreDirectory, "diagnostics.log"), 0, 0)
if err != nil {
return nil, common.ContextErrorMsg(err, "failed to initialize diagnostic logging")
}
}

err = psiphon.OpenDataStore(config)
if err != nil {
return nil, common.ContextErrorMsg(err, "failed to open data store")
Expand Down

0 comments on commit 4c2cbfe

Please sign in to comment.