From e95cc99ea2be4c14ae6a920e3188c40e064cfe6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 20 Sep 2021 00:19:10 +0200 Subject: [PATCH] fix whitespaces. --- internal/http/router.go | 4 ++++ internal/webrtc/pionlog/logger.go | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/internal/http/router.go b/internal/http/router.go index 20e4f03c..137b986e 100644 --- a/internal/http/router.go +++ b/internal/http/router.go @@ -39,12 +39,15 @@ func (r *router) Route(pattern string, fn func(types.Router)) { func (r *router) Get(pattern string, fn types.RouterHandler) { r.chi.Get(pattern, routeHandler(fn)) } + func (r *router) Post(pattern string, fn types.RouterHandler) { r.chi.Post(pattern, routeHandler(fn)) } + func (r *router) Put(pattern string, fn types.RouterHandler) { r.chi.Put(pattern, routeHandler(fn)) } + func (r *router) Delete(pattern string, fn types.RouterHandler) { r.chi.Delete(pattern, routeHandler(fn)) } @@ -62,6 +65,7 @@ func (r *router) WithBypass(fn func(next http.Handler) http.Handler) types.Route func (r *router) Use(fn types.MiddlewareHandler) { r.chi.Use(middlewareHandler(fn)) } + func (r *router) UseBypass(fn func(next http.Handler) http.Handler) { r.chi.Use(fn) } diff --git a/internal/webrtc/pionlog/logger.go b/internal/webrtc/pionlog/logger.go index 7e48d90e..f9e66172 100644 --- a/internal/webrtc/pionlog/logger.go +++ b/internal/webrtc/pionlog/logger.go @@ -15,17 +15,21 @@ type logger struct { func (l logger) Trace(msg string) { l.logger.Trace().Msg(strings.TrimSpace(msg)) } + func (l logger) Tracef(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) l.logger.Trace().Msg(strings.TrimSpace(msg)) } + func (l logger) Debug(msg string) { l.logger.Debug().Msg(strings.TrimSpace(msg)) } + func (l logger) Debugf(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) l.logger.Debug().Msg(strings.TrimSpace(msg)) } + func (l logger) Info(msg string) { if strings.Contains(msg, "duplicated packet") { return @@ -33,6 +37,7 @@ func (l logger) Info(msg string) { l.logger.Info().Msg(strings.TrimSpace(msg)) } + func (l logger) Infof(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) if strings.Contains(msg, "duplicated packet") { @@ -41,16 +46,20 @@ func (l logger) Infof(format string, args ...interface{}) { l.logger.Info().Msg(strings.TrimSpace(msg)) } + func (l logger) Warn(msg string) { l.logger.Warn().Msg(strings.TrimSpace(msg)) } + func (l logger) Warnf(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) l.logger.Warn().Msg(strings.TrimSpace(msg)) } + func (l logger) Error(msg string) { l.logger.Error().Msg(strings.TrimSpace(msg)) } + func (l logger) Errorf(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) l.logger.Error().Msg(strings.TrimSpace(msg))