merge master

This commit is contained in:
john
2018-09-20 09:30:05 +08:00
3 changed files with 7 additions and 2 deletions

View File

@ -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{}{}
}

View File

@ -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

View File

@ -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) {