debug

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableDebug

func DisableDebug()

DisableDebug concurrent safe helper to disable debug information in the stderr.

func EnableDebug

func EnableDebug()

EnableDebug concurrent safe helper to enable debug information in the stderr.

func GetStackTraceInString

func GetStackTraceInString(pick ...int) string

GetStackTraceInString return the stack trace utilizing runtime.Caller but only pick the first line that has `/app/`.

Will always return the stack trace even when DisableDebug already called. May be used when just want to get the stack trace without caring the debug state.

func GetStackTraceOnDebug

func GetStackTraceOnDebug(pick ...int) string

GetStackTraceOnDebug return information from GetStackTraceInString if the internal state of debug is enabled. It can be enabled with EnableDebug.

May be used when need to get the stack trace only if the debug is enabled, since calling runtime.Caller is expensive.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL