mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 17:15:31 +00:00
Introduced basic structure
This commit is contained in:
20
helpers/logging.go
Normal file
20
helpers/logging.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package helpers
|
||||
|
||||
import "fmt"
|
||||
|
||||
func LogOnDebug[T fmt.Stringer](object T, msg string) {
|
||||
if msg != "" {
|
||||
fmt.Println(msg)
|
||||
}
|
||||
fmt.Println(object)
|
||||
}
|
||||
|
||||
func LogOnErr[T fmt.Stringer](object T, err error, msg string) {
|
||||
if err != nil {
|
||||
if msg != "" {
|
||||
fmt.Println(msg)
|
||||
}
|
||||
fmt.Println(object)
|
||||
fmt.Println("Error: ", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user