Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Create helper for logs and add documentation #2795

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

lenriquez
Copy link
Contributor

Signed-off-by: Luis Enriquez [email protected]

What this PR does / why we need it:
Plugin Developer would like to know how to use logs inside of a plugin

Which issue(s) this PR fixes

Special notes for your reviewer:

  • It could be necessary to have a policy to truncate the log file
  • Also it may be necessary to change the plugin logs if production mode
    Release note:
release-note

@lenriquez lenriquez marked this pull request as draft August 24, 2021 13:41
@lenriquez lenriquez marked this pull request as ready for review August 24, 2021 15:09
Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Would like to see some documentation added to the current Storybook section we have for Go Plugins that shows basic usage / examples of logging Info vs. Warn vs. Error.

@lenriquez lenriquez force-pushed the issue-816 branch 4 times, most recently from 9b54253 to 17b7b10 Compare August 30, 2021 17:56
@@ -42,13 +42,35 @@ rm ~/.config/octant/plugins/octant-sample-plugin

After deleting the plugin binary and restarting Octant, you should no longer see the plugin available as part of Octant.

## Logs

Octant use go-plugin library, this library allows "Any plugins that use the log standard library will have log data automatically sent to the host process." by default with granularity level INFO, to set the log's granularity Octant provides a LoggerHelper that can be use this way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: uses go-plugin (maybe link to repo)

Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with 1 minor request from @GuessWhoSamFoo

@lenriquez lenriquez force-pushed the issue-816 branch 2 times, most recently from b737a52 to ae6c95c Compare September 1, 2021 22:15
@lenriquez lenriquez merged commit b9fe28b into vmware-archive:master Sep 2, 2021
@lenriquez lenriquez deleted the issue-816 branch September 2, 2021 00:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More granular logging support for plugins
3 participants