diff options
Diffstat (limited to 'meselog')
-rw-r--r-- | meselog/meselog.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/meselog/meselog.go b/meselog/meselog.go new file mode 100644 index 0000000..d9c84f5 --- /dev/null +++ b/meselog/meselog.go @@ -0,0 +1,26 @@ +package meselog + +import ( + "fmt" +) + +func log(str string, keyvals []any) { + fmt.Print(str+" ") + for i, j := range keyvals { + if i & 1 == 0 { + fmt.Printf("%v=", j) + } else if i == len(keyvals) - 1 { + fmt.Printf("%#v", j) + } else { + fmt.Printf("%#v ", j) + } + } + fmt.Print("\n") +} + +func Error(str string, keyvals ...any) { + log("ERROR "+str, keyvals) +} +func Debug(str string, keyvals ...any) { + log("DEBUG "+str, keyvals) +} |