|
|
@@ -60,6 +60,12 @@ type Parameters struct {
|
|
|
// Zero means there will be no timeout.
|
|
|
// Optional.
|
|
|
EstablishTunnelTimeoutSeconds *int
|
|
|
+
|
|
|
+ // EmitDiagnosticNoticesToFile indicates whether to use the rotating log file
|
|
|
+ // facility to record diagnostic notices instead of sending diagnostic
|
|
|
+ // notices to noticeReceiver. Has no effect unless the tunnel
|
|
|
+ // config.EmitDiagnosticNotices flag is set.
|
|
|
+ EmitDiagnosticNoticesToFiles bool
|
|
|
}
|
|
|
|
|
|
// PsiphonTunnel is the tunnel object. It can be used for stopping the tunnel and
|
|
|
@@ -154,11 +160,7 @@ 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 {
|
|
|
+ if config.EmitDiagnosticNotices && params.EmitDiagnosticNoticesToFiles {
|
|
|
err := psiphon.SetNoticeFiles("", filepath.Join(config.DataStoreDirectory, "diagnostics.log"), 0, 0)
|
|
|
if err != nil {
|
|
|
return nil, common.ContextErrorMsg(err, "failed to initialize diagnostic logging")
|