Documentation
¶
Index ¶
- func ContextWithLogger(ctx context.Context, logger *zap.Logger) context.Context
- func EnsureLogFile(logPath string) error
- func LoggerFromContext(ctx context.Context) (*zap.Logger, bool)
- func NewLogger(levelStr, logPath string) (*zap.Logger, error)
- func NewLoggerWithStderr(levelStr, logPath string, includeStderr bool) (*zap.Logger, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithLogger ¶
ContextWithLogger returns a new context with the given logger.
func EnsureLogFile ¶
EnsureLogFile ensures the log file and its directory exist.
func LoggerFromContext ¶
LoggerFromContext retrieves the logger from the given context, or returns false if not found.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.