gf/os/glog/glog_z_unit_test.go
2019-11-01 20:36:09 +08:00

29 lines
738 B
Go

// Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package glog
import (
"github.com/gogf/gf/test/gtest"
"testing"
)
func Test_SetConfigWithMap(t *testing.T) {
gtest.Case(t, func() {
l := New()
m := map[string]interface{}{
"path": "/tmp/log",
"level": LEVEL_PROD,
"stdout-print": true,
}
err := l.SetConfigWithMap(m)
gtest.Assert(err, nil)
gtest.Assert(l.config.Path, m["path"])
gtest.Assert(l.config.Level, m["level"])
gtest.Assert(l.config.StdoutPrint, m["stdout-print"])
})
}