Skip to content

Add LogFormatContainer and LogLevelContainer for exposing the configured LogFormat and LogLevel#7

Merged
doriable merged 3 commits intomainfrom
expose-log-formats
Apr 6, 2026
Merged

Add LogFormatContainer and LogLevelContainer for exposing the configured LogFormat and LogLevel#7
doriable merged 3 commits intomainfrom
expose-log-formats

Conversation

@doriable
Copy link
Copy Markdown
Member

This adds a LogFormatContainer to Container that exposes
the LogFormat configured to the container. This allows output
that is rendered outside of the Logger to use the same configs,
e.g. color.

Comment thread appext/appext.go Outdated
return newLoggerContainer(logger)
}

// LogFormatContainer provides the [LogFormat] set for the [Container].
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No other comments in this package use this form

Comment thread appext/appext.go
}

// LogFormatContainer provides the [LogFormat] set for the [Container].
type LogFormatContainer interface {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No Godoc

Comment thread appext/appext.go
type Container interface {
NameContainer
LoggerContainer
LogFormatContainer
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Strictly speaking, this is all a breaking change, can you explain a bit more why you need this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My use-case specifically is for rendering the report from our compiler. I'd like to pass on configurations from the CLI framework so that report.Renderer can respect color configs from the user.

@doriable doriable changed the title Add LogFormatContainer for exposing the configured LogFormat Add LogFormatContainer and LogLevelContainer for exposing the configured LogFormat and LogLevel Mar 24, 2026
@doriable doriable requested a review from bufdev March 30, 2026 23:14
@doriable doriable merged commit e13ab05 into main Apr 6, 2026
5 checks passed
@doriable doriable deleted the expose-log-formats branch April 6, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants