Skip to content

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

Open
doriable wants to merge 3 commits intomainfrom
expose-log-formats
Open

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

Conversation

@doriable
Copy link
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.

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

// LogFormatContainer provides the [LogFormat] set for the [Container].
Copy link
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

}

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

Choose a reason for hiding this comment

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

No Godoc

type Container interface {
NameContainer
LoggerContainer
LogFormatContainer
Copy link
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
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
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