mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-28 16:45:32 +00:00
27 lines
385 B
Go
27 lines
385 B
Go
package helpers
|
|
|
|
import "fmt"
|
|
|
|
func LogOnDebug[T fmt.Stringer](object *T, msg string) {
|
|
if msg != "" {
|
|
fmt.Println(msg)
|
|
}
|
|
|
|
if object != nil {
|
|
fmt.Println(*object)
|
|
}
|
|
}
|
|
|
|
func LogOnErr[T fmt.Stringer](object *T, err error, msg string) {
|
|
if err != nil {
|
|
if msg != "" {
|
|
fmt.Println(msg)
|
|
}
|
|
|
|
if object != nil {
|
|
fmt.Println(*object)
|
|
}
|
|
fmt.Println("Error: ", err)
|
|
}
|
|
}
|