MCPcopy
hub / github.com/lxc/incus / Pretty

Function Pretty

shared/logger/format.go:10–17  ·  view source on GitHub ↗

Pretty will attempt to convert any Go structure into a string suitable for logging.

(input any)

Source from the content-addressed store, hash-verified

8
9// Pretty will attempt to convert any Go structure into a string suitable for logging.
10func Pretty(input any) string {
11 pretty, err := json.MarshalIndent(input, "\t", "\t")
12 if err != nil {
13 return fmt.Sprintf("%v", input)
14 }
15
16 return fmt.Sprintf("\n\t%s", pretty)
17}
18
19// GetStack will convert the Go stack into a string suitable for logging.
20func GetStack() string {

Callers 3

rawQueryMethod · 0.92
queryStructMethod · 0.92
queryOperationMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…