Documentation ¶
Index ¶
Constants ¶
View Source
const WrapDepth__DisablePC = -10000
Variables ¶
This section is empty.
Functions ¶
func Log ¶
func Log(ctx context.Context, handler slog.Handler, wrapDepth int, level slog.Level, attrs []any, msg string)
Logs to given slog Handler
func LogAttrs ¶
func LogAttrs(ctx context.Context, handler slog.Handler, wrapDepth int, level slog.Level, attrs []slog.Attr, msg string)
Logs to given slog Handler
func PC ¶
Returns the program counter of the calling goroutine depth will skip a given number of stack frames in the case of func F() any { return PC(0) } will return a location inside of F program counter can be used with logging to translate to a source line
func Record ¶
Create record wrapDepth will control how the PC (source line) is resolved wrapDepth defines the number of frames to skip if wrapDepth < 0 then PC is not resolved NOTE: Wrappers will add to wrapDepth without checking it's value, so you should set it to a large negative value, like WrapDepth__DisablePC to disable
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.