func logPanics(handle http.HandlerFunc) http.HandlerFunc{
return func(write http.ResponseWriter,request *http.Request){
defer func(){
if x := recover(); x!=nil{
log.Printf("[%v] caught panic:%v",request.RemoteAddr,x)
}
}()
handle(write, request)
}
}