mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-02 05:34:25 +00:00
* 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>
25 lines
426 B
Go
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)
|
|
}
|