chore: add comments to peerlog plugin about being unsupported
and also about the ugly config semantics (cherry picked from commit ae09459e3926d687599638abdb379e8627b53509)
guseggert committed
Aug 25, 2021 at 14:43 UTC
810a1749e0bf0d51c77abbc96827a2f95a8ce5b4
1 file changed
+6
-1
plugin/plugins/peerlog/peerlog.go
+6
-1
@@ -36,7 +36,7 @@ type plEvent struct {
36
peer peer.ID
37
}
38
39
-// Log all the PeerIDs we see
39
+// Log all the PeerIDs. This is considered internal, unsupported, and may break at any point.
40
//
41
// Usage:
42
// GOLOG_FILE=~/peer.log IPFS_LOGGING_FMT=json ipfs daemon
@@ -67,6 +67,11 @@ func (*peerLogPlugin) Version() string {
67
return "0.1.0"
68
}
69
70
+// extractEnabled extracts the "Enabled" field from the plugin config.
71
+// Do not follow this as a precedent, this is only applicable to this plugin,
72
+// since it is internal-only, unsupported functionality.
73
+// For supported functionality, we should rework the plugin API to support this use case
74
+// of including plugins that are disabled by default.
75
func extractEnabled(config interface{}) bool {
76
// plugin is disabled by default, unless Enabled=true
77
if config == nil {