Documentation
¶
Index ¶
Constants ¶
const ( // we can only have info, debug and error log levels when using // logr/zapr: https://github.com/go-logr/logr/issues/258 INFO = 0 DEBUG = 1 DebugLevel LogLevel = "debug" InfoLevel LogLevel = "info" TextFormat LogFormat = "text" JsonFormat LogFormat = "json" )
const ( EphemeralLogLevel = "EPHEMERAL_LOG_LEVEL" EphemeralLogFormat = "EPHEMERAL_LOG_FORMAT" )
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
NewLogger will use the given opts to build a new logr.Logger instance. It will use zap and the underlying Logger implementation. This function should be called only during the service initialization.
func NewPluginLogger ¶
NewPluginLogger will initialize a logger to be used in ephemeral-access plugins.
Types ¶
type LogConfig ¶
type LogConfig struct {
// contains filtered or unexported fields
}
LogConfig is a LogConfigurer implementation
type LogWrapper ¶
LogWrapper provides more expressive methods than the ones provided by the logr.Logger interface abstracting away the usage of numeric log levels.
func FromContext ¶
func FromContext(ctx context.Context, keysAndValues ...interface{}) *LogWrapper
FromContext will return a new log wrapper with the extracted logger from the given context.
func New ¶
func New(opts ...Opts) (*LogWrapper, error)
New will initialize a new log wrapper with the provided logger.
func (*LogWrapper) Debug ¶
func (l *LogWrapper) Debug(msg string, keysAndValues ...any)
Debug logs a non-error message with debug level. If provided, the given key/value pairs are added in the log entry context.
func (*LogWrapper) Error ¶
func (l *LogWrapper) Error(err error, msg string, keysAndValues ...any)
Error logs an error message. If provided, the given key/value pairs are added in the log entry context.
func (*LogWrapper) Info ¶
func (l *LogWrapper) Info(msg string, keysAndValues ...any)
Info logs a non-error message with info level. If provided, the given key/value pairs are added in the log entry context.