mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
merge master
This commit is contained in:
@ -175,6 +175,7 @@ func GetServer(name...interface{}) (*Server) {
|
||||
closeQueue : gqueue.New(),
|
||||
logger : glog.New(),
|
||||
}
|
||||
s.logger.SetStdPrint(false)
|
||||
for _, v := range strings.Split(gHTTP_METHODS, ",") {
|
||||
s.methodsMap[v] = struct{}{}
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ func (s *Server)handleRequest(w http.ResponseWriter, r *http.Request) {
|
||||
// 如果是目录需要处理index files
|
||||
if len(s.config.IndexFiles) > 0 {
|
||||
for _, file := range s.config.IndexFiles {
|
||||
fpath := s.paths.Search(filePath + gfile.Separator + file)
|
||||
fpath := s.paths.Search(file)
|
||||
if fpath != "" {
|
||||
filePath = fpath
|
||||
request.isFileRequest = true
|
||||
|
||||
@ -73,7 +73,11 @@ func (l *Logger) GetLevel() int {
|
||||
|
||||
// 快捷方法,打开或关闭DEBU日志信息
|
||||
func (l *Logger) SetDebug(debug bool) {
|
||||
l.level.Set(l.level.Val()|LEVEL_DEBU)
|
||||
if debug {
|
||||
l.level.Set(l.level.Val()|LEVEL_DEBU)
|
||||
} else {
|
||||
l.level.Set(l.level.Val()&^LEVEL_DEBU)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *Logger) SetBacktrace(enabled bool) {
|
||||
|
||||
Reference in New Issue
Block a user