Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add LogMessage and move LogStabilityLevel #5633

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
apply review feedback
  • Loading branch information
codeboten committed Jul 7, 2022
commit 0b4c3170cd2f41f4ce020663339cea61c5fff9dd
14 changes: 7 additions & 7 deletions component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,19 @@ func (sl StabilityLevel) String() string {
func (sl StabilityLevel) LogMessage() string {
switch sl {
case StabilityLevelUnmaintained:
return "This component is unmaintained and actively looking for contributors. This component will become deprecated after 6 months of remaining unmaintained."
return "Unmaintained component. Actively looking for contributors. Component will become deprecated after 6 months of remaining unmaintained."
case StabilityLevelDeprecated:
return "This component has been deprecated and will be removed in future releases."
return "Deprecated component. Will be removed in future releases."
case StabilityLevelInDevelopment:
return "This component is in development and may change in the future."
return "In development component. May change in the future."
case StabilityLevelAlpha:
return "This component is alpha and may change in the future."
return "Alpha component. May change in the future."
case StabilityLevelBeta:
return "This component is beta and may change in the future."
return "Beta component. May change in the future."
case StabilityLevelStable:
return "This component is stable."
return "Stable component."
}
return "The stability level of this component is undefined"
return "Stability level of component is undefined"
}

// Factory is implemented by all component factories.
Expand Down
2 changes: 1 addition & 1 deletion service/internal/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

// LogStabilityLevel logs the stability level of a component. The log level is set to info for
// log levels: undefined, unmaintained, deprecated and in development. The log level is set to debug
// undefined, unmaintained, deprecated and in development. The log level is set to debug
// for alpha, beta and stable.
func LogStabilityLevel(logger *zap.Logger, sl component.StabilityLevel) {
codeboten marked this conversation as resolved.
Show resolved Hide resolved
if sl >= component.StabilityLevelAlpha {
Expand Down
2 changes: 1 addition & 1 deletion service/internal/components/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"go.opentelemetry.io/collector/component"
)

func TestLogStabilityLevle(t *testing.T) {
func TestLogStabilityLevel(t *testing.T) {
tests := []struct {
level zapcore.Level
expectedLogs int
Expand Down