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
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
Next Next commit
add docstring
  • Loading branch information
codeboten committed Jul 7, 2022
commit d45168c5953acc3944b6e6defdd7a72a80ad74d9
11 changes: 11 additions & 0 deletions service/internal/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ import (
"go.uber.org/zap"
)

StabilityLevelUndefined = iota // skip 0, start types from 1.
StabilityLevelUnmaintained
StabilityLevelDeprecated
StabilityLevelInDevelopment
StabilityLevelAlpha
StabilityLevelBeta
StabilityLevelStable

// 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
codeboten marked this conversation as resolved.
Show resolved Hide resolved
// 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 {
logger.Debug(sl.LogMessage(), zap.String(ZapStabilityKey, sl.String()))
Expand Down