Skip to content

Commit

Permalink
chore: add comments to peerlog plugin about being unsupported
Browse files Browse the repository at this point in the history
and also about the ugly config semantics
  • Loading branch information
guseggert committed Aug 25, 2021
1 parent c3ac1b4 commit ae09459
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/plugins/peerlog/peerlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ae09459

Please sign in to comment.