chore(day17): log output
Go Bump / bump (push) Successful in 6s
Go Test / build (push) Successful in 40s

This commit is contained in:
xuu
2024-01-01 12:44:08 -07:00
parent fd85530d88
commit adc01f4df9
2 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
)
func Runner[R any, F func(*bufio.Scanner) (R, error)](run F) (R, error) {
@@ -33,7 +34,10 @@ func MustResult[T any](result T, err error) {
Log("result", result)
}
func Log(v ...any) { fmt.Fprintln(os.Stderr, v...) }
func Log(v ...any) {
fmt.Fprint(os.Stderr, time.Now(), ": ")
fmt.Fprintln(os.Stderr, v...)
}
func Logf(format string, v ...any) {
if !strings.HasSuffix(format, "\n") {
format += "\n"