evcc-io/charger/ocpp_test_logger.go
2025-10-31 15:25:53 +00:00

28 lines
715 B
Go

package charger
import (
"fmt"
"testing"
"time"
)
type ocppLogger struct {
t *testing.T
}
func print(t *testing.T, s string) {
t.Log((time.Now().Format(time.DateTime)), s)
}
func (l *ocppLogger) Debug(args ...any) { print(l.t, fmt.Sprint(args...)) }
func (l *ocppLogger) Debugf(format string, args ...any) {
print(l.t, fmt.Sprintf(format, args...))
}
func (l *ocppLogger) Info(args ...any) { print(l.t, fmt.Sprint(args...)) }
func (l *ocppLogger) Infof(format string, args ...any) {
print(l.t, fmt.Sprintf(format, args...))
}
func (l *ocppLogger) Error(args ...any) { print(l.t, fmt.Sprint(args...)) }
func (l *ocppLogger) Errorf(format string, args ...any) {
print(l.t, fmt.Sprintf(format, args...))
}