fiber/log/fiberlog_test.go
Jiun Lee fefc533834
🚀 Add Logger interface and fiberlog (#2499)
* add log for fiber

* replace log in fiber

* add Log use to adapt for log libraries

* Update app.go

Co-authored-by: Tomás Warynyca <41587659+tomaswarynyca@users.noreply.github.com>

* wip: add log docs

* add WithLogger use to print key and value

* remove CtxLogger and add WithContext use to bind Context

* fix errcheck

* fix errcheck

* update log.md

---------

Co-authored-by: Tomás Warynyca <41587659+tomaswarynyca@users.noreply.github.com>
2023-06-26 08:16:57 +02:00

25 lines
426 B
Go

package log
import (
"log"
"os"
"testing"
"github.com/gofiber/fiber/v2/utils"
)
func Test_DefaultSystemLogger(t *testing.T) {
defaultL := DefaultLogger()
utils.AssertEqual(t, logger, defaultL)
}
func Test_SetLogger(t *testing.T) {
setLog := &defaultLogger{
stdlog: log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile|log.Lmicroseconds),
depth: 6,
}
SetLogger(setLog)
utils.AssertEqual(t, logger, setLog)
}