Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns a logr.Logger instance based on the provided context and key-value pairs. The logger is retrieved from the context using clog.FromContext method. The key-value pairs are optional and can be used for additional logging information. It expects a context.Context as the first argument, followed by optional key-value pairs. It returns a logr.Logger instance.
func InitCmdLogger ¶
InitCmdLogger setup callback that initializes the logger configuration.
func WithContext ¶
WithContext adds a logr.Logger to the provided context. The logr.Logger is added using clog.IntoContext(). The context returned will have the added logr.Logger included.
Example usage:
ctx := context.Background() logger := logr.New() ctxWithLogger := WithContext(ctx, logger)
Parameters:
- ctx: The context to add the logger to.
- log: The logr.Logger to add to the context.
Returns:
The modified context with the added logr.Logger.
Types ¶
This section is empty.