From ae09459e3926d687599638abdb379e8627b53509 Mon Sep 17 00:00:00 2001 From: guseggert <877588+guseggert@users.noreply.github.com> Date: Wed, 25 Aug 2021 14:43:48 -0400 Subject: [PATCH] chore: add comments to peerlog plugin about being unsupported and also about the ugly config semantics --- plugin/plugins/peerlog/peerlog.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/plugins/peerlog/peerlog.go b/plugin/plugins/peerlog/peerlog.go index 685e179a9..b73722c2c 100644 --- a/plugin/plugins/peerlog/peerlog.go +++ b/plugin/plugins/peerlog/peerlog.go @@ -36,7 +36,7 @@ type plEvent struct { peer peer.ID } -// Log all the PeerIDs we see +// Log all the PeerIDs. This is considered internal, unsupported, and may break at any point. // // Usage: // GOLOG_FILE=~/peer.log IPFS_LOGGING_FMT=json ipfs daemon @@ -67,6 +67,11 @@ func (*peerLogPlugin) Version() string { return "0.1.0" } +// extractEnabled extracts the "Enabled" field from the plugin config. +// Do not follow this as a precedent, this is only applicable to this plugin, +// since it is internal-only, unsupported functionality. +// For supported functionality, we should rework the plugin API to support this use case +// of including plugins that are disabled by default. func extractEnabled(config interface{}) bool { // plugin is disabled by default, unless Enabled=true if config == nil {