traceUtils

package module
v0.0.0-...-e5be028 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

README

Common

Why ?

  • to reuse code
  • syntax sugar to enable 3rd party libraries to be consumed a certian way
  • stop reinventing the wheel
  • help provide a baseline of functionality for a given software project

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStackTrace

func NewStackTrace(opts ...StackTraceOption) []byte

NewStackTrace - returns a nicely formatted stack trace according to cfg, default is full verbose stack trace. modified from https://github.com/gin-gonic/gin/blob/master/recovery.go#L111-L169

Types

type StackTraceConfig

type StackTraceConfig struct {
	SkipFrames        int
	IncludeSourceCode bool
	IncludePC         bool
	ShortFuncNames    bool
	ShowFullPath      bool
	ShowLineNumbers   bool
	FrameSeparator    string
	ChunkSeparator    string
	ChunkIndentation  string
}

StackTraceConfig allows configuring the detail level of the printed stack trace.

type StackTraceOption

type StackTraceOption func(*StackTraceConfig)

func WithChunkIndentation

func WithChunkIndentation(chunkIndentation string) StackTraceOption

func WithChunkSeparator

func WithChunkSeparator(chunkSeparator string) StackTraceOption

func WithFrameSeparator

func WithFrameSeparator(frameSeparator string) StackTraceOption

func WithIncludePC

func WithIncludePC(include bool) StackTraceOption

func WithIncludeSourceCode

func WithIncludeSourceCode(include bool) StackTraceOption

func WithShortFuncNames

func WithShortFuncNames(short bool) StackTraceOption

func WithShowFullPath

func WithShowFullPath(full bool) StackTraceOption

func WithShowLineNumbers

func WithShowLineNumbers(show bool) StackTraceOption

func WithSkipFrames

func WithSkipFrames(skip int) StackTraceOption

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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