Documentation
¶
Index ¶
Constants ¶
View Source
const ( Error = "error" Took = "took" )
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
Inits the go standart logger, based on env mode.
func LogFunc ¶ added in v1.0.0
func LogFunc( ctx context.Context, logger *slog.Logger, funcName string, err error, extraAttrs ...slog.Attr, )
LogFunc logs a function call with optional extra attributes. It records the request ID from context and any error passed. Timing is NOT recorded here. Use this when you only want to log function entry or results without measuring duration.
func LogFuncWithTiming ¶ added in v1.0.0
func LogFuncWithTiming( ctx context.Context, logger *slog.Logger, funcName string, begin time.Time, err error, extraAttrs ...slog.Attr, )
LogFuncWithTiming logs a function call including the elapsed time since `begin`. It records the request ID from context, the duration, any error, and optional extra attributes. Use this when you want to measure and log the time taken by a function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.